cli: fix updater

This commit is contained in:
Koushik Dutta
2024-03-25 12:45:10 -07:00
parent a3df934a88
commit c94fb231c6
3 changed files with 8 additions and 8 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "scrypted",
"version": "1.3.13",
"version": "1.3.14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "scrypted",
"version": "1.3.13",
"version": "1.3.14",
"license": "ISC",
"dependencies": {
"@scrypted/client": "^1.3.3",

View File

@@ -1,6 +1,6 @@
{
"name": "scrypted",
"version": "1.3.13",
"version": "1.3.14",
"description": "",
"main": "./dist/packages/cli/src/main.js",
"bin": {

View File

@@ -133,11 +133,7 @@ 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);
@@ -145,6 +141,10 @@ export async function serveMain(installVersion?: string) {
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);