From e9bebbbaa7e2a1ae9f2fe0e1f3a604f2588bef92 Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Fri, 28 May 2021 08:34:26 +0930 Subject: [PATCH] fix: ensure correct env is shown if it's changed within app --- app/cli.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/cli.ts b/app/cli.ts index 6b3b82ed3..818a2f78a 100644 --- a/app/cli.ts +++ b/app/cli.ts @@ -90,7 +90,7 @@ const commands = { setEnv('LOG_TRANSPORT', mainOptions['log-transport']); setEnv('PORT', mainOptions.port); - console.log(`Starting unraid-api in "${environment}" mode.`); + console.log(`Starting unraid-api in "${process.env.ENVIRONMENT!}" mode.`); // Load bundled index file const indexPath = './index.js'; @@ -207,7 +207,7 @@ const commands = { } // Copy the new env over before restarting - await fs.promises.copyFile(path.join(basePath, `.env.${currentEnv ?? 'production'}`), path.join(basePath, '.env')) + await fs.promises.copyFile(path.join(basePath, `.env.${currentEnv ?? 'production'}`), path.join(basePath, '.env')); // Restart the process return this.restart();