From 25917faf9153106d7ef249f949a00b901ffbd33c Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Wed, 26 May 2021 07:39:40 +1000 Subject: [PATCH] add support for --cleanexit option (#388) --- src/cli/baseProgram.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cli/baseProgram.ts b/src/cli/baseProgram.ts index 962a273271..c440bfb69d 100644 --- a/src/cli/baseProgram.ts +++ b/src/cli/baseProgram.ts @@ -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; }