Skip to content

Commit 63e8a29

Browse files
Josh Goldbergnchen63
Josh Goldberg
authored andcommittedNov 25, 2016
Added final onComplete, returns after onCompletes (palantir#1787)
1 parent 3def898 commit 63e8a29

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/runner.ts

+4
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export class Runner {
151151
if (!fs.existsSync(this.options.project)) {
152152
console.error("Invalid option for project: " + this.options.project);
153153
onComplete(1);
154+
return;
154155
}
155156
program = Linter.createProgram(this.options.project, path.dirname(this.options.project));
156157
if (files.length === 0) {
@@ -216,6 +217,7 @@ export class Runner {
216217
if (!fs.existsSync(file)) {
217218
console.error(`Unable to open file: ${file}`);
218219
onComplete(1);
220+
return;
219221
}
220222

221223
const buffer = new Buffer(256);
@@ -244,6 +246,8 @@ export class Runner {
244246
this.outputStream.write(lintResult.output, () => {
245247
if (lintResult.failureCount > 0) {
246248
onComplete(this.options.force ? 0 : 2);
249+
} else {
250+
onComplete(0);
247251
}
248252
});
249253

0 commit comments

Comments
 (0)
Please sign in to comment.