Skip to content

Commit 7278a3f

Browse files
committed
Use -m for running jobs manually
1 parent aeda69e commit 7278a3f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"lint": "tslint --project .",
1212
"lint-fix": "tslint --fix --project .",
1313
"ncu": "ncu --semverLevel major -e 2",
14-
"test-yml-spec": "node -r source-map-support/register dist/index.js manual_job_invoked_from_cli --cwd tests/test-yml-spec"
14+
"test-yml-spec": "node -r source-map-support/register dist/index.js -m manual_job_invoked_from_cli --cwd tests/test-yml-spec"
1515
},
1616
"bin": "dist/index.js",
1717
"dependencies": {

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ process.env.CI_PIPELINE_ID = makeid(10);
4646

4747
const argv = yargs.argv;
4848
const cwd = argv.cwd || process.cwd();
49+
const m: any = argv.m;
50+
const manualArgs: string[] = [].concat(m || []);
4951

5052
const parser = new Parser(cwd, logger);
5153

@@ -64,7 +66,7 @@ const runJobs = async () => {
6466
const jobNames = `${jobs.map((j) => j.name).join(" ")}`;
6567
console.log(`=> ${c.yellow(`${stageName}`)} > ${c.blueBright(`${jobNames}`)} ${c.magentaBright("starting")}...`);
6668
for (const job of jobs) {
67-
if (job.isManual() && !argv._.includes(job.name)) {
69+
if (job.isManual() && !manualArgs.includes(job.name)) {
6870
console.log(`${c.blueBright(`${job.name}`)} skipped. Manual job`);
6971
continue;
7072
}

0 commit comments

Comments
 (0)