From 7d761ebe30eb3b8015bc6670ab4a1d3286129570 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Fri, 2 Jun 2017 14:46:46 +0200 Subject: [PATCH] Only set exitCode instead of exiting immediately --- package.json | 2 +- src/tslint-cli.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2aeaa65aac3..cb19fc1a5c8 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/tslint-cli.ts b/src/tslint-cli.ts index c14551c82a0..454a7411559 100644 --- a/src/tslint-cli.ts +++ b/src/tslint-cli.ts @@ -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}`;