-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(powershell): use Invoke-Expression to pass args #8278
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Thanks again for your effort!
Don't know when npm 11 series will be bundled with Nodejs 20/22 but would it be possible for this to get backported to npm 10 series? |
Getting it into npm 10 would simply be a matter of opening a PR into Getting that backported into node is something we are working on. The script that does this is currently failing and needs attention. |
At this point npm 11 will not be in node 20/22 |
A collaborator needs to approve PRs before they can be landed, so I have done that. My approval was wholly dependent on @mbtools approval. Thanks to everyone who participated in this, it was not a trivial task. I will merge this later today unless someone finds something egregious that you all missed. |
Ahh I forgot that node 20 including this change doesn't matter since ps1 scripts aren't there in that release |
needed to make a change to escape grave key " ` " in directories since that's a valid key in Windows @mbtools @wraithgar please review, this was the last character I was worried about and the latest commit fixes it |
lgtm 👍 |
Waiting on #8280 to land first so that CI goes back to green. |
Once this PR lands, I'll use git cherry-pick to make a backport PR for v10 |
The easiest path to landing this in Please be aware that the current node PR script is not working to make backports, that's on our list of things to triage so that we can get node 22 up to date w/ the latest npm 10. |
Continuation of npm#8267 @mbtools --- This fixes the command `npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world"` in Windows PowerShell and pwsh7 - where the "test" script prints all the arguments passed after the first "--" in the command above Before this change ``` PS> npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world" npm warn "world" is being parsed as a normal command line argument. npm warn "hello world" is being parsed as a normal command line argument. npm warn Unknown cli config "--p1". This will stop working in the next major version of npm. npm warn Unknown cli config "--p2". This will stop working in the next major version of npm. npm warn Unknown cli config "--q1". This will stop working in the next major version of npm. npm warn Unknown cli config "--q2". This will stop working in the next major version of npm. > [email protected] test > node args.js hello world hello world world hello world hello world world ``` With this change ``` PS> npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world" > [email protected] test > node args.js hello -p1 world -p2 hello world --q1=hello world --q2=hello world hello -p1 world -p2 hello world --q1=hello world --q2=hello world ``` --- Also, fixes comma-separated values in Windows PowerShell and pwsh7 Before this change ``` PS> npm help a=1,b=2,c=3 No matches in help for: a=1 b=2 c=3 ``` With this change ``` PS> npm help a=1,b=2,c=3 No matches in help for: a=1,b=2,c=3 ```
Fixes #7375 |
Thanks heaps @alexsch01 and everyone else involved! |
@wraithgar just want to let you know in case anyone is trying this by doing It has to be installed in the NodeJS directory which I manually tested worked |
Continuation of npm#8267 @mbtools --- This fixes the command `npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world"` in Windows PowerShell and pwsh7 - where the "test" script prints all the arguments passed after the first "--" in the command above Before this change ``` PS> npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world" npm warn "world" is being parsed as a normal command line argument. npm warn "hello world" is being parsed as a normal command line argument. npm warn Unknown cli config "--p1". This will stop working in the next major version of npm. npm warn Unknown cli config "--p2". This will stop working in the next major version of npm. npm warn Unknown cli config "--q1". This will stop working in the next major version of npm. npm warn Unknown cli config "--q2". This will stop working in the next major version of npm. > [email protected] test > node args.js hello world hello world world hello world hello world world ``` With this change ``` PS> npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world" > [email protected] test > node args.js hello -p1 world -p2 hello world --q1=hello world --q2=hello world hello -p1 world -p2 hello world --q1=hello world --q2=hello world ``` --- Also, fixes comma-separated values in Windows PowerShell and pwsh7 Before this change ``` PS> npm help a=1,b=2,c=3 No matches in help for: a=1 b=2 c=3 ``` With this change ``` PS> npm help a=1,b=2,c=3 No matches in help for: a=1,b=2,c=3 ```
Requires #8297 and #8303 after
This fixes the command
npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world"
in Windows PowerShell and pwsh7Before this change
With this change
Also, fixes comma-separated values in Windows PowerShell and pwsh7
Before this change
With this change