mirror of
https://github.com/unraid/api.git
synced 2026-01-01 22:20:05 -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> {
|
async run(_, options: StartCommandOptions): Promise<void> {
|
||||||
this.logger.info('Starting the Unraid API');
|
this.logger.info('Starting the Unraid API');
|
||||||
const envLog = options['log-level'] ? `LOG_LEVEL=${options['log-level']}` : '';
|
const envLog = options['log-level'] ? `LOG_LEVEL=${options['log-level']}` : '';
|
||||||
const { stderr, stdout } = await execa(
|
const { stderr, stdout } = await execa(`${envLog} ${PM2_PATH}`.trim(), [
|
||||||
`${envLog} ${PM2_PATH}`.trim(),
|
'start',
|
||||||
['start', ECOSYSTEM_PATH, '--update-env'],
|
ECOSYSTEM_PATH,
|
||||||
{ stdio: 'inherit' }
|
'--update-env',
|
||||||
);
|
]);
|
||||||
if (stdout) {
|
if (stdout) {
|
||||||
this.logger.log(stdout);
|
this.logger.log(stdout);
|
||||||
process.exit(0);
|
|
||||||
}
|
}
|
||||||
if (stderr) {
|
if (stderr) {
|
||||||
this.logger.error(stderr);
|
this.logger.error(stderr);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option({
|
@Option({
|
||||||
|
|||||||
Reference in New Issue
Block a user