From 89ececdbeb1d73f4eb7152b27fcc255a6a32fa8d Mon Sep 17 00:00:00 2001 From: Isaac Grynsztein Date: Wed, 1 Apr 2020 19:31:41 -0400 Subject: [PATCH] Dependencies now install during update --- backend/app.js | 16 +++++++++++++--- package.json | 24 ++++++++++++------------ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/backend/app.js b/backend/app.js index f2b023d..33e1647 100644 --- a/backend/app.js +++ b/backend/app.js @@ -137,9 +137,6 @@ async function startServer() { }); } - // getLatestVersion(); - // restartServer(); - updateServer(); } async function restartServer() { @@ -173,6 +170,9 @@ async function updateServer() { // grab new package.json and public folder await downloadUpdateFiles(); + // run npm install + await installDependencies(); + restartServer(); }); } @@ -244,6 +244,16 @@ async function downloadLatestRelease(tag) { }); } + +async function installDependencies() { + return new Promise(resolve => { + var child_process = require('child_process'); + child_process.execSync('npm install',{stdio:[0,1,2]}); + resolve(true); + }); + +} + // helper function to download file using fetch const fetchFile = (async (url, path) => { const res = await fetch(url); diff --git a/package.json b/package.json index 544d2cf..d98f1de 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,17 @@ "private": true, "dependencies": { "@angular-devkit/core": "^9.0.6", - "@angular/animations": "^9.0.6", + "@angular/animations": "^9.1.0", "@angular/cdk": "^9.1.2", - "@angular/common": "^9.0.6", - "@angular/compiler": "^9.0.6", - "@angular/core": "^9.0.6", - "@angular/forms": "^9.0.6", - "@angular/localize": "^9.0.6", - "@angular/material": "^9.1.2", - "@angular/platform-browser": "^9.0.6", - "@angular/platform-browser-dynamic": "^9.0.6", - "@angular/router": "^9.0.6", + "@angular/common": "^9.1.0", + "@angular/compiler": "^9.1.0", + "@angular/core": "^9.1.0", + "@angular/forms": "^9.1.0", + "@angular/localize": "^9.1.0", + "@angular/material": "^9.2.0", + "@angular/platform-browser": "^9.1.0", + "@angular/platform-browser-dynamic": "^9.1.0", + "@angular/router": "^9.1.0", "@locl/core": "0.0.1-beta.2", "core-js": "^2.4.1", "file-saver": "^2.0.2", @@ -48,8 +48,8 @@ "devDependencies": { "@angular-devkit/build-angular": "^0.901.0", "@angular/cli": "^9.1.0", - "@angular/compiler-cli": "^9.0.6", - "@angular/language-service": "^9.0.6", + "@angular/compiler-cli": "^9.1.0", + "@angular/language-service": "^9.1.0", "@locl/cli": "0.0.1-beta.6", "@types/core-js": "^2.5.2", "@types/file-saver": "^2.0.1",