diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-03-14 20:48:29 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-03-14 20:48:29 -0400 |
commit | 7cb1add2a8d5febb0a3a5a90d7c4af461780bfe1 (patch) | |
tree | 669674210c1df096e100d686883eb39dd885b07b | |
parent | f44508b54e255897cbc4101539ca311dd39df42a (diff) | |
download | tanzanite-7cb1add2a8d5febb0a3a5a90d7c4af461780bfe1.tar.gz tanzanite-7cb1add2a8d5febb0a3a5a90d7c4af461780bfe1.tar.bz2 tanzanite-7cb1add2a8d5febb0a3a5a90d7c4af461780bfe1.zip |
fix: don't displayPrompt after exit
-rw-r--r-- | src/lib/utils/BushLogger.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index 02803d5..8556a77 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -13,7 +13,12 @@ const REPL = repl.start({ breakEvalOnSigint: true }); -REPL.on('exit', () => process.exit(0)); +let replGone = false; + +REPL.on('exit', () => { + replGone = true; + process.exit(0); +}); /** * Custom logging utility for the bot. @@ -39,7 +44,7 @@ export class BushLogger { if (type === 'log') console.log([...arguments].slice(1)); else stream.write(`${content}\n`); stream.moveCursor(0, typeof content === 'string' ? content.split('\n').length : 1); - REPL.displayPrompt(true); + if (!replGone) REPL.displayPrompt(true); } public static raw(...content: any[]) { |