-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quote zero-length strings in arguments #1551
Conversation
If a zero-length string is passed, it does not get properly quoted, and then it is not properly passed to the child process
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
I'll fix this commit message on merge. What was the case that caused this to be a bug (out of interest)? |
I have a tool that uses nodemon to launch a wrapper around an api, where, to be lazy, I just use the position of arguments rather than any kind of arg parsing. I pass empty args to indicate that they're not set. The code looks like this: const args = [pkg, argv.entryFile || '', argv.api || '', argv.configFile || '']
const nodemonConfig = {
script: resolve('.runner-build/index.js'),
args,
stdout: true,
delay: 0.5,
ignore,
}
if (argv.runnerWatch) {
nodemonConfig.watch = ['.', resolve('.runner-build')]
}
const n = nodemon(nodemonConfig) Hope that makes sense! |
If a zero-length string is passed, it does not get properly quoted, and then it is not properly passed to the child process
I noticed this issue when using nodemon to monitor a wrapper script, where i basically pass a bunch of arguments like function arguments.
TODO: update the commit message to fit your convention. I just did this quickly in the github editor.