We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
argv
_
foo
#!/usr/bin/env zx console.log(process.argv) let name = argv._[1] echo(`Hello, ${name}.`)
When running $ ./foo Brandon:
$ ./foo Brandon
{ _: [ 'Brandon' ] }
{ _: [ './foo', 'Brandon' ] }
zx
This seems to be happening because zx is passing an extra argument: the cli.js file.
cli.js
Log just process.argv from the zx script:
process.argv
[ '/Users/blp/Library/pnpm/nodejs/16.15.1/bin/node', '/Users/blp/Library/pnpm/global/5/node_modules/zx/build/cli.js', './foo', 'Brandon' ]
Could zx use process.argv.slice(3) when setting up minimist?
process.argv.slice(3)
The text was updated successfully, but these errors were encountered:
Yes, lets add more tests for this bug and fix it.
Sorry, something went wrong.
Fixed!
How is it fixed? Was there a new release?
Yes.
Successfully merging a pull request may close this issue.
Given file:
foo
When running
$ ./foo Brandon
:Expected Behavior
{ _: [ 'Brandon' ] }
Actual Behavior
{ _: [ './foo', 'Brandon' ] }
Steps to Reproduce the Problem
zx
script usingargv
This seems to be happening because
zx
is passing an extra argument: thecli.js
file.Log just
process.argv
from thezx
script:Could
zx
useprocess.argv.slice(3)
when setting up minimist?Specifications
The text was updated successfully, but these errors were encountered: