chore(gulp): don't run pub get in parallel to avoid a race condition
This commit is contained in:
parent
24d190c9a8
commit
e32ddcc7eb
27
gulpfile.js
27
gulpfile.js
|
@ -129,17 +129,24 @@ gulp.task('modules/build.dart/pubspec', function() {
|
||||||
done();
|
done();
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest(outputDir));
|
.pipe(gulp.dest(outputDir));
|
||||||
// We need to wait for all pubspecs to be present before executing
|
// 1. We need to wait for all pubspecs to be present before executing
|
||||||
// `pub get` as it checks the folders of the dependencies!
|
// `pub get` as it checks the folders of the dependencies!
|
||||||
return streamToPromise(changedStream)
|
// 2. We execute `pub get` commands sequentially to avoid race condition with pub cache
|
||||||
.then(function() {
|
var promise = streamToPromise(changedStream).then(function() {
|
||||||
return Q.all(files.map(function(file) {
|
for (var i = 0; i < files.length; i++) {
|
||||||
return processToPromise(spawn(DART_SDK.PUB, ['get'], {
|
(function (file) {
|
||||||
stdio: 'inherit',
|
promise = promise.then(function() {
|
||||||
cwd: path.dirname(file)
|
return processToPromise(spawn(DART_SDK.PUB, ['get'], {
|
||||||
}));
|
stdio: 'inherit',
|
||||||
}));
|
cwd: path.dirname(file)
|
||||||
});
|
}));
|
||||||
|
});
|
||||||
|
})(files[i]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return promise;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function processToPromise(process) {
|
function processToPromise(process) {
|
||||||
|
|
Loading…
Reference in New Issue