]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: wait for gulp tasks ends with the `finish` event 11205/head
authorNicolas Coden <nicolas@ncoden.fr>
Sun, 29 Apr 2018 13:26:38 +0000 (15:26 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sun, 29 Apr 2018 13:26:38 +0000 (15:26 +0200)
`pipe(done)` is a mistake and pipe does not work that way.
`on('end')` may not be triggered because `end` is an interval stream event that does not reflect the whole gulp stream operation. Only `finish` should be used to wait for the operation end.

See: https://stackoverflow.com/a/41003102/4317384

gulp/tasks/customizer.js
gulp/tasks/deploy.js
gulp/tasks/test.js

index 041e63147c074b685cd1f324e668312874436267..6740487b82c8c4ff07319c7bfa7b0ba10249aacf 100644 (file)
@@ -109,7 +109,7 @@ gulp.task('customizer:sass', function(done) {
       .pipe(cleancss({ compatibility: 'ie9' }))
       .pipe(rename('foundation.min.css'))
       .pipe(gulp.dest(path.join(OUTPUT_DIR, 'css')))
-      .on('end', done);
+      .on('finish', done);
   });
 });
 
index e7f6b7e06590d46daac23de649f999545e003d88..6af30d780da2b7c2e6b177da58b458f28420fcfa 100644 (file)
@@ -89,7 +89,7 @@ gulp.task('deploy:dist', function(done) {
         .pipe(sourcemaps.write('.'))
         .pipe(gulp.dest('./dist/js'))
 
-      .pipe(done);
+      .on('finish', done);
   });
 });
 
@@ -190,6 +190,6 @@ gulp.task('deploy:custom', function(done) {
         .pipe(uglify())
         .pipe(rename('foundation.min.js'))
         .pipe(gulp.dest('./_build/assets/js'))
-        .on('end', done);
+        .on('finish', done);
   });
 });
index d37d0469b3fad6c22255ac9628b266794df8c996..ecb14c91032a163cc7d83c1e6c680ab54d4a1f53 100644 (file)
@@ -41,6 +41,6 @@ gulp.task('test:transpile-js', function(done) {
         .on('error', onBabelError))
       .pipe(concat('js-tests.js'))
       .pipe(gulp.dest('test/javascript'))
-      .on('end', done);
+      .on('finish', done);
   });
 });