add support for --cleanexit option (#388)

This commit is contained in:
Thomas Rittson 2021-05-26 07:39:40 +10:00 committed by GitHub
parent bacb84ca78
commit 25917faf91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -21,10 +21,11 @@ export abstract class BaseProgram {
this.writeLn(chalk.redBright(response.message), true, true);
}
}
const exitCode = process.env.BW_CLEANEXIT ? 0 : 1;
if (exitImmediately) {
process.exit(1);
process.exit(exitCode);
} else {
process.exitCode = 1;
process.exitCode = exitCode;
}
return;
}