feat: cli v0.2.0

This commit is contained in:
Gabriel Pastori
2023-11-14 11:38:22 -03:00
parent 5e0c55b489
commit b6f447bb0a
16 changed files with 1297 additions and 7 deletions

View File

@@ -0,0 +1,18 @@
const { exec } = require('child_process');
module.exports = async () => {
return new Promise((resolve, reject) => {
exec('pm2 jlist', async (err, stdout) => {
if (err) {
console.log('⚙️ PM2 is not installed');
return reject(false);
}
const list = JSON.parse(stdout);
const process = list.find((process) => process.name === 'evolution-manager');
resolve(process ? process.pm_id : false);
});
});
}