mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
fix: start command simplification
This commit is contained in:
@@ -21,19 +21,19 @@ export class StartCommand extends CommandRunner {
|
||||
async run(_, options: StartCommandOptions): Promise<void> {
|
||||
this.logger.info('Starting the Unraid API');
|
||||
const envLog = options['log-level'] ? `LOG_LEVEL=${options['log-level']}` : '';
|
||||
const { stderr, stdout } = await execa(
|
||||
`${envLog} ${PM2_PATH}`.trim(),
|
||||
['start', ECOSYSTEM_PATH, '--update-env'],
|
||||
{ stdio: 'inherit' }
|
||||
);
|
||||
const { stderr, stdout } = await execa(`${envLog} ${PM2_PATH}`.trim(), [
|
||||
'start',
|
||||
ECOSYSTEM_PATH,
|
||||
'--update-env',
|
||||
]);
|
||||
if (stdout) {
|
||||
this.logger.log(stdout);
|
||||
process.exit(0);
|
||||
}
|
||||
if (stderr) {
|
||||
this.logger.error(stderr);
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
@Option({
|
||||
|
||||
Reference in New Issue
Block a user