Skip to content

Commit

Permalink
cli: fix updater
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 25, 2024
1 parent a3df934 commit c94fb23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scrypted",
"version": "1.3.13",
"version": "1.3.14",
"description": "",
"main": "./dist/packages/cli/src/main.js",
"bin": {
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,18 @@ export async function serveMain(installVersion?: string) {

await startServer(installDir);

if (fs.existsSync(EXIT_FILE)) {
console.log('Exiting.');
process.exit(1);
}
else if (fs.existsSync(UPDATE_FILE)) {
if (fs.existsSync(UPDATE_FILE)) {
console.log('Update requested. Installing.');
await runCommandEatError('npm', '--prefix', installDir, 'install', '--production', '@scrypted/server@latest').catch(e => {
console.error('Update failed', e);
});
console.log('Exiting.');
process.exit(1);
}
else if (fs.existsSync(EXIT_FILE)) {
console.log('Exiting.');
process.exit(1);
}
else {
console.log(`Service unexpectedly exited. Restarting momentarily.`);
await sleep(10000);
Expand Down

0 comments on commit c94fb23

Please sign in to comment.