feat: stop-backend.js and update.js linux support (#712)

* chore(dependabot.yml): update target-branch from "develop" to "dev" for npm package updates in /api, /client, and root directory

* feat: stop-backend.js and update.js linux support (#701)

* feat: stop-backend.js and update.js linux support

* feat: update.js sudo support

* chore(helpers.js): add deleteNodeModules function
feat(packages.js): add script to delete node_modules and install dependencies
refactor(update.js): remove unnecessary imports and use deleteNodeModules function
feat(package.json): add update:linux script to update with sudo

* chore(package.json): rename 'update:linux'  script to 'update:sudo'

* refactor(update.js): simplify downCommand and buildCommand by removing redundant use of sudo command, add sudo to single docker command

---------

Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>
This commit is contained in:
Danny Avila 2023-07-27 11:11:56 -04:00 committed by GitHub
parent d59a3f20cb
commit 777d64088b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 20 deletions

23
config/stop-backend.js Normal file
View file

@ -0,0 +1,23 @@
// eslint-disable-next-line
const helpers = require('./helpers');
const { exec } = require('child_process');
const { promisify } = require('util');
const isWindows = process.platform === 'win32';
const execAsync = promisify(exec);
async function main() {
try {
if (isWindows) {
console.red('The backend process has been terminated');
await execAsync('taskkill /F /IM node.exe /T');
} else {
await execAsync('pkill -f api/server/index.js');
console.orange('The backend process has been terminated');
}
} catch (err) {
console.red('The backend process has been terminated', err.message);
}
}
main();