Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 29ef920

Browse files
committed
chore: fix race condition
1 parent 893b5b9 commit 29ef920

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

gulpfile.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function runE2e() {
195195
return spawnInfo.promise;
196196
})
197197
.then(function() {
198-
copyExampleBoilerplate();
198+
buildStyles(copyExampleBoilerplate, _.noop);
199199
gutil.log('runE2e: update webdriver');
200200
spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PROTRACTOR_PATH});
201201
return spawnInfo.promise;
@@ -419,7 +419,7 @@ gulp.task('help', taskListing.withFilters(function(taskName) {
419419
}));
420420

421421
// requires admin access because it adds symlinks
422-
gulp.task('add-example-boilerplate', function() {
422+
gulp.task('add-example-boilerplate', function(done) {
423423
var realPath = path.join(EXAMPLES_PATH, '/node_modules');
424424
var nodeModulesPaths = excludeDartPaths(getNodeModulesPaths(EXAMPLES_PATH));
425425

@@ -435,24 +435,24 @@ gulp.task('add-example-boilerplate', function() {
435435
fsUtils.addSymlink(realPath, linkPath);
436436
});
437437

438-
return buildStyles(copyExampleBoilerplate);
438+
return buildStyles(copyExampleBoilerplate, done);
439439
});
440440

441441

442442
// copies boilerplate files to locations
443443
// where an example app is found
444-
gulp.task('_copy-example-boilerplate', function () {
445-
if (!argv.fast) return buildStyles(copyExampleBoilerplate);
444+
gulp.task('_copy-example-boilerplate', function (done) {
445+
if (!argv.fast) buildStyles(copyExampleBoilerplate, done);
446446
});
447447

448448
//Builds Angular 2 Docs CSS file from Bootstrap npm LESS source
449449
//and copies the result to the _examples folder to be included as
450450
//part of the example boilerplate.
451-
function buildStyles(cb){
452-
return gulp.src(path.join(STYLES_SOURCE_PATH, _styleLessName))
451+
function buildStyles(cb, done){
452+
gulp.src(path.join(STYLES_SOURCE_PATH, _styleLessName))
453453
.pipe(less())
454-
.pipe(gulp.dest(EXAMPLES_PATH)).on('finish', function(){
455-
return cb();
454+
.pipe(gulp.dest(EXAMPLES_PATH)).on('end', function(){
455+
cb().then(function() { done(); });
456456
});
457457
}
458458

0 commit comments

Comments
 (0)