-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
d59a3f2
commit 777d640
Showing
6 changed files
with
80 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { execSync } = require('child_process'); | ||
const path = require('path'); | ||
|
||
const { deleteNodeModules } = require('./helpers'); | ||
|
||
// Set the directories | ||
const rootDir = path.resolve(__dirname, '..'); | ||
const directories = [ | ||
rootDir, | ||
path.resolve(rootDir, 'packages', 'data-provider'), | ||
path.resolve(rootDir, 'client'), | ||
path.resolve(rootDir, 'api'), | ||
]; | ||
|
||
(async () => { | ||
// Delete all node_modules | ||
directories.forEach(deleteNodeModules); | ||
|
||
// Run npm cache clean --force | ||
console.purple('Cleaning npm cache...'); | ||
execSync('npm cache clean --force', { stdio: 'inherit' }); | ||
|
||
// Install dependencies | ||
console.purple('Installing dependencies...'); | ||
execSync('npm install', { stdio: 'inherit' }); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters