Skip to content

Commit e679b2e

Browse files
author
Andy
authored
Merge pull request microsoft#13683 from Microsoft/workers
Add "workers" option in gulpfile.
2 parents 73735b7 + 128b84d commit e679b2e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Gulpfile.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
5050
r: "reporter",
5151
color: "colors",
5252
f: "files",
53-
file: "files"
53+
file: "files",
54+
w: "workers",
5455
},
5556
default: {
5657
soft: false,
@@ -63,6 +64,7 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
6364
reporter: process.env.reporter || process.env.r,
6465
lint: process.env.lint || true,
6566
files: process.env.f || process.env.file || process.env.files || "",
67+
workers: process.env.workerCount || os.cpus().length,
6668
}
6769
});
6870

@@ -604,7 +606,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
604606
} while (fs.existsSync(taskConfigsFolder));
605607
fs.mkdirSync(taskConfigsFolder);
606608

607-
workerCount = process.env.workerCount || os.cpus().length;
609+
workerCount = cmdLineOptions["workers"];
608610
}
609611

610612
if (tests || light || taskConfigsFolder) {
@@ -1017,7 +1019,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
10171019
cb();
10181020
}, (cb) => {
10191021
files = files.filter(file => fileMatcher.test(file.path)).sort((filea, fileb) => filea.stat.size - fileb.stat.size);
1020-
const workerCount = (process.env.workerCount && +process.env.workerCount) || os.cpus().length;
1022+
const workerCount = cmdLineOptions["workers"];
10211023
for (let i = 0; i < workerCount; i++) {
10221024
spawnLintWorker(files, finished);
10231025
}

0 commit comments

Comments
 (0)