mirror of
https://github.com/unraid/api.git
synced 2026-01-13 20:19:56 -06:00
fix: ensure correct env is shown if it's changed within app
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user