cli: exit after updates

This commit is contained in:
Koushik Dutta
2024-03-19 12:11:51 -07:00
parent a35fd3b79b
commit 4e21db52e2
4 changed files with 10 additions and 6 deletions

View File

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

View File

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

View File

@@ -138,10 +138,14 @@ export async function serveMain(installVersion?: string) {
}
else if (fs.existsSync(UPDATE_FILE)) {
console.log('Update requested. Installing.');
await runCommandEatError('npm', '--prefix', installDir, 'install', '--production', '@scrypted/server@latest');
await runCommandEatError('npm', '--prefix', installDir, 'install', '--production', '@scrypted/server@latest').catch(e => {
console.error('Update failed', e);
});
console.log('Exiting.');
process.exit();
}
else {
console.log(`Service exited. Restarting momentarily.`);
console.log(`Service unexpectedly exited. Restarting momentarily.`);
await sleep(10000);
}
}