forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpubget.js
More file actions
36 lines (30 loc) · 1008 Bytes
/
pubget.js
File metadata and controls
36 lines (30 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var util = require('./util');
var spawn = require('child_process').spawn;
var path = require('path');
var travisFoldStart = require('../travis/travis-fold');
module.exports = {
dir: pubGetDir,
subDir: pubGetSubDir
};
function pubGetDir(gulp, plugins, config) {
return function() {
var travisFoldEnd = travisFoldStart(`pubget-${config.dir}`);
return util.processToPromise(spawn(config.command, ['upgrade'], {
stdio: 'inherit',
cwd: config.dir
})).then(travisFoldEnd);
};
};
function pubGetSubDir(gulp, plugins, config) {
return function() {
var travisFoldEnd = travisFoldStart(`pubget-${config.command}-${config.dir}`);
// We need to execute pubspec serially as otherwise we can get into trouble
// with the pub cache...
return util.forEachSubDirSequential(config.dir, function(subDir) {
return util.processToPromise(spawn(config.command, ['upgrade'], {
stdio: 'inherit',
cwd: subDir
}));
}).then(travisFoldEnd);
};
};