From d1653c3408a177ecfcb1fbb6898c810c1f94fc12 Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:21:59 -0300 Subject: [PATCH] Add cwd option to pm2 serve command --- lib/pm2/setup.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pm2/setup.js b/lib/pm2/setup.js index 5b0653a..2622b0a 100644 --- a/lib/pm2/setup.js +++ b/lib/pm2/setup.js @@ -2,6 +2,7 @@ const build = require('../utils/build.js'); const verifyPm2Installation = require('../utils/verifyPm2Installation.js'); const detectPm2ProcessId = require('../utils/detectPm2ProcessId.js'); const { exec } = require('child_process') +const path = require('path') module.exports = async (argv) => { const port = argv.port || 9615; @@ -19,7 +20,7 @@ module.exports = async (argv) => { console.log('⚙️ Starting PM2 process') console.time('⚙️ Starting PM2 process') - exec(`pm2 serve dist/ ${port} --name evolution-manager --spa`, (err, stdout) => { + exec(`pm2 serve dist/ ${port} --name evolution-manager --spa`, { cwd: path.join(__dirname, '..', '..') }, (err, stdout) => { if (err) { console.error(err) return diff --git a/package.json b/package.json index f208103..478d596 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-manager", - "version": "0.2.6", + "version": "0.2.7", "main": "dist", "scripts": { "dev": "vite",