Skip to content

Commit 2433246

Browse files
committed
allow restarting build
1 parent 1261742 commit 2433246

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

build.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,23 @@ var fs = require('fs');
44

55
var excludedDirectories = ['css', 'dist','node_modules','webdriver-java'];
66

7+
// set the following variable to resume building with a framework and skip all
8+
// other frameworks that would be buils before
9+
var restartWithFramework = '';
10+
var build = !restartWithFramework ? true : false;
11+
712
_.each(fs.readdirSync('.'), function(name) {
813
if(fs.statSync(name).isDirectory() && name[0] !== '.' && excludedDirectories.indexOf(name)==-1) {
9-
console.log("Executing npm run build-prod in "+name);
10-
exec('npm run build-prod', {
11-
cwd: name,
12-
stdio: 'inherit'
13-
});
14+
console.log("build", build, "restartWithFramework", restartWithFramework, name.startsWith(restartWithFramework));
15+
if (!build && name.startsWith(restartWithFramework)) build = true;
16+
if (build) {
17+
console.log("Executing npm run build-prod in "+name);
18+
exec('npm run build-prod', {
19+
cwd: name,
20+
stdio: 'inherit'
21+
});
22+
} else {
23+
console.log("Skipping npm run build-prod in "+name);
24+
}
1425
}
1526
});

0 commit comments

Comments
 (0)