Skip to content

[rush] Honor script-shell when running rushx commands - #6218

Open
doomfrawen wants to merge 3 commits into
microsoft:mainfrom
doomfrawen:fix/rushx-script-shell
Open

doomfrawen wants to merge 3 commits into
microsoft:mainfrom
doomfrawen:fix/rushx-script-shell

Conversation

@doomfrawen

Copy link
Copy Markdown

Summary

rushx now honors script-shell in common/config/rush/.npmrc. This lets a Windows project run a Bash package script with rushx using the same shell it uses with npm run.

Fixes #5076.

Details

Read the repository setting using Rush’s existing .npmrc environment-variable rules. Pass the script to the selected shell and quote forwarded arguments for Bash, PowerShell, or cmd.exe. The setting applies to rushx package scripts.

How it was tested

  • Built @microsoft/rush-lib and ran its full suite on Linux (1,981 passed, 2 skipped). rush change --verify passed.
  • Ran the published and patched CLIs on Linux. The reporter’s echo "$0" example used sh before the fix and /bin/bash after it, matching npm run.
  • Ran Windows Node and Git for Windows under Wine. Git Bash expanded $0 and preserved spaced, quoted, and empty arguments, including with a space in the shell path. Checked the default shell and ordinary Rush global commands as controls.
  • Ran PowerShell Core on Linux and checked that apostrophes, literal dollar signs, empty arguments, and cmdlet switches were forwarded correctly.

Impacted documentation

@doomfrawen

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

[rush] Npm script-shell Setting Not Respected by rush

1 participant