Skip to content

Commit

Permalink
Only set exitCode instead of exiting immediately (palantir#2867)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajafff authored and adidahiya committed Jun 2, 2017
1 parent 07eb8da commit d87c52d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"lint:global": "tslint --project test/tsconfig.json --format stylish --type-check # test includes 'src' too",
"lint:from-bin": "node bin/tslint --project test/tsconfig.json --format stylish",
"test": "npm-run-all test:pre -p test:mocha test:rules",
"test:pre": "cd ./test/config && npm install",
"test:pre": "cd ./test/config && npm install --no-save",
"test:mocha": "mocha --reporter spec --colors \"build/test/**/*Tests.js\"",
"test:rules": "node ./build/test/ruleTestRunner.js",
"verify": "npm-run-all clean compile lint test docs",
Expand Down
7 changes: 6 additions & 1 deletion src/tslint-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ run({
}, {
log,
error: (m) => console.error(m),
}).then(process.exit);
}).then((rc) => {
process.exitCode = rc;
}).catch((e) => {
console.error(e);
process.exitCode = 1;
});

function optionUsageTag({short, name}: Option) {
return short !== undefined ? `-${short}, --${name}` : `--${name}`;
Expand Down

0 comments on commit d87c52d

Please sign in to comment.