Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
scripts: Add support for "!" in build script to ignore a path
Browse files Browse the repository at this point in the history
bilou84 committed Feb 23, 2016
1 parent 0964ddd commit 9ab29ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
@@ -50,7 +50,11 @@ function build() {
if (argv._.length > 0) {
const filter = argv._[0].replace(/[\\/]/g, path.sep);
const oldPathCount = buildPaths.length;
buildPaths = buildPaths.filter((buildPath) => path.relative(rootPath, buildPath).toLowerCase().indexOf(filter.toLowerCase()) !== -1);
if (filter[0] === "!") {
buildPaths = buildPaths.filter((buildPath) => path.relative(rootPath, buildPath).toLowerCase().indexOf(filter.slice(1).toLowerCase()) === -1);
} else {
buildPaths = buildPaths.filter((buildPath) => path.relative(rootPath, buildPath).toLowerCase().indexOf(filter.toLowerCase()) !== -1);
}
log(`Rebuilding "${filter}", leaving out ${oldPathCount - buildPaths.length} paths`);
}

0 comments on commit 9ab29ab

Please sign in to comment.