This commit is contained in:
Sefinek committed 2025-01-18 15:51:08 +01:00
1 parent 699354b85a
commit 8322427457
8 files changed
+143 -9

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
const { exec } = require('node:child_process');
const ecosystem = require('../ecosystem.config.js');
const executeCommand = cmd =>
new Promise((resolve, reject) => {
exec(cmd, (err, stdout, stderr) => {
if (err || stderr) reject(err || stderr);
else resolve(stdout);
});
});
module.exports = async () => {
try {
console.log(await executeCommand('npm install --omit=dev'));
console.log(await executeCommand(`pm2 restart ${ecosystem.apps[0].name}`));
} catch (err) {
console.error(err);
}
};