There are two or more projects on node js.
For example, the first project is located in the folder: "/project/one", inside one of the js functions we execute:
const projectTwoPath = "/project/two";
exec(`sh ${projectTwoPath}/projectRun.sh`, ...)
exec(`sh ./projectRun.sh`, {cwd: projectTwoPath }, ...)
projectRun.sh
contains:
npx prisma migrate dev
pm2 start npm --name "project-two" -- run start
The script is executed, but for project One. Question: how to run this script so that it is executed for project Two, being in "/project/one", so that it is executed for the node in "/project/two"? (Option can be from the Linux console, or can within node exec(or shelljs) example)