Then they'll come find this bug, and go back and fix their code.Ī non-replacement "exec" exists in the windows APIs for this purpose (as far as I know, exec-replace doesn't exist on windows). Every consumer of the process.exec/spawn API is going to eventually run into this quoting issue when a user of theirs has the program in a path with a space. This is problematic because the execFile/spawn call accepts "args" arguments: why would one need to quote the executable in the "command" parameter to prevent it from being arg split, if there exists an args parameter? I expected that the executable path is the simply the "command" parameter, and the "args" to contain the arguments. What we need is having a way to launch a process without having to worry about quoting the executable (something that did not work for me, but I'll try again). Not exactly, process replacement isn't the issue. It's unlikely that the name will change anytime soon. I expect to have to quote args in C "system", but I do not expect that for "exec". The confusion is understandable when they're not analogous to behavior of POSIX functions, because they're named after mismatched POSIX counterparts. The initshell() function detects the operating system with the platform module and returns an object that’s an abstraction around the system-specific shell. Citing that as the reason for their behavior. You indicated that this is the expected behavior of "system" which is named after the system C call which is different from the exec C call. bin/sh: /Applications/My: No such file or directoryĪpplications/My Application.app/Contents/tools/myScript.sh failed: Error: Exit with error code: 127 Additional information The shell script is executed properly What do you see instead? Ive configured this manually using host-spawn and it works really great, since Ive done this, I couldnt find any of the annoying bugs that were there before. It would be cool if it could default to a host-shell (bash, in most cases). Yes, the child_process module should be properly escaping commands that have spaces in them since we cannot control where the user installs the application. The shell currently defaults to a sandboxed plain sh, which is not what most developers want. then ( ) How often does it reproduce? Is there a required condition?Įvery single time. Async function executeChildProcess ( executable, argList ) executeChildProcess ( '/Applications/My Application.app/Contents/tools/myScript.sh', ).
0 Comments
Leave a Reply. |