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

fix --print process.argv <args> #17251

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

fix --print process.argv <args> #17251

wants to merge 13 commits into from

Conversation

RiskyMH
Copy link
Member

@RiskyMH RiskyMH commented Feb 11, 2025

What does this PR do?

2 fixes:

  1. include the 1st command name in argv (with --print, clap gets confused)
  2. if the filename ends in /[eval] or /[stdin], then don't include it in argv, like node

fixes #12209, fixes #8381, fixes #17236

How did you verify your code works?

manually and made tests

@RiskyMH RiskyMH requested a review from nektro February 11, 2025 05:02
@robobun
Copy link

robobun commented Feb 11, 2025

Updated 10:09 AM PT - Feb 11th, 2025

@RiskyMH, your commit 9cc0f2e has 6 failures in Build #11442:


🧪   try this PR locally:

bunx bun-pr 17251

src/js/node/child_process.ts Outdated Show resolved Hide resolved
Comment on lines 61 to 66
const exe = isWindows ? bunExe().replace("/", "\\") : bunExe();
testProcessArgv([], [exe]);
testProcessArgv(["abc", "def"], [exe, "abc", "def"]);
testProcessArgv(["--", "abc", "def"], [exe, "abc", "def"]);
// testProcessArgv(["--", "abc", "--", "def"], [exe, "abc", "--", "def"]);
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why this last test doesn't work in Bun, but it is valid in node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants