Skip to content
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

bun --eval ignores first command line arg #12209

Open
cjmalloy opened this issue Jun 27, 2024 · 1 comment
Open

bun --eval ignores first command line arg #12209

cjmalloy opened this issue Jun 27, 2024 · 1 comment
Labels
bug Something isn't working cli Something to do with CLI arguments good first issue Something that would be good for new contributors

Comments

@cjmalloy
Copy link

cjmalloy commented Jun 27, 2024

What version of Bun is running?

1.1.17+bb66bba1b

What platform is your computer?

Linux 5.4.0-186-generic x86_64 x86_64

What steps can reproduce the bug?

chris@eggnog:~$ bun -e "console.log(process.argv)" 1 2 3
[ "/home/chris/.bun/bin/bun", "/home/chris/[eval]", "2", "3" ]
chris@eggnog:~$ node -e "console.log(process.argv)" 1 2 3
[ '/home/chris/.nvm/versions/node/v20.14.0/bin/node', '1', '2', '3' ]
chris@eggnog:~$ bun --version
1.1.17

What is the expected behavior?

Should match node and not ignore the first argument.

What do you see instead?

First argument missing.

Additional information

Similarly for bun --print.

My workaround is to just include a placeholder arg and modify argv:

chris@eggnog:~$ bun -e "process.argv.splice(1, 1); console.log(process.argv)" skip 1 2 3
[ "/home/chris/.bun/bin/bun", "1", "2", "3" ]
chris@eggnog:~$ node -e "process.argv.splice(1, 1); console.log(process.argv)" skip 1 2 3
[ '/home/chris/.nvm/versions/node/v20.14.0/bin/node', '1', '2', '3' ]
@cjmalloy cjmalloy added bug Something isn't working needs triage labels Jun 27, 2024
@paperdave paperdave added good first issue Something that would be good for new contributors cli Something to do with CLI arguments and removed needs triage labels Jun 27, 2024
@mookums
Copy link

mookums commented Jun 28, 2024

Is this available? I can work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Something to do with CLI arguments good first issue Something that would be good for new contributors
Projects
None yet
Development

No branches or pull requests

3 participants