From 7cb1add2a8d5febb0a3a5a90d7c4af461780bfe1 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 14 Mar 2022 20:48:29 -0400 Subject: fix: don't displayPrompt after exit --- src/lib/utils/BushLogger.ts | 9 +++++++-- 1 file 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[]) { -- cgit