fix: restart command elegant

This commit is contained in:
Eli Bosley
2025-01-28 10:11:24 -05:00
parent cdfb3c772b
commit b9249544fc

View File

@@ -12,19 +12,19 @@ export class RestartCommand extends CommandRunner {
async run(_): Promise<void> {
try {
this.logger.info('Restarting the Unraid API');
this.logger.info('Restarting the Unraid API...');
const { stderr, stdout } = await execa(PM2_PATH, [
'restart',
ECOSYSTEM_PATH,
'--update-env',
]);
this.logger.info('Unraid API restarted');
if (stderr) {
this.logger.error(stderr);
process.exit(1);
}
if (stdout) {
} else if (stdout) {
this.logger.info(stdout);
} else {
this.logger.info('Unraid API restarted');
}
} catch (error) {
if (error instanceof Error) {