Is there any way in node.js to fork a new process and run multiple terminal shell commands and execute node.js functions such as fs.writeFileSync from that same process/context.
As an example I want to do the following. Execute all the below in the same process.
exec("git worktree add -b"....);
exec("cd ../");
writeFileSync(...);
This is an express.js applcation, and because multiple users will be accessing the same filesystem at the same time and performing git actions on the same repo, I want to avoid conflicts by spawning a new process for each one.