Implementing-Python-Client_#19 #32

Merged
logan merged 9 commits from Implementing-Python-Client_#19 into master 2024-04-06 03:22:20 -04:00
Showing only changes of commit ea63abcb93 - Show all commits

View File

@@ -12,9 +12,15 @@ const runningProcesses = {};
* @param {string[]} args - The arguments to pass to the process.
* @param {boolean} waitForClose - Set this to wait to return until the process exits
*/
export const launchProcess = (processName, args, waitForClose=false) => {
export const launchProcess = (processName, args, waitForClose=false, pcwd=undefined) => {
if (!runningProcesses[processName]) {
const childProcess = spawn(processName, args);
let childProcess;
if (pcwd) {
childProcess = spawn(processName, args, {cwd: pcwd});
}
else {
childProcess = spawn(processName, args);
}
// Store reference to the spawned process
runningProcesses[processName] = childProcess;