[rush] Npm script-shell
Setting Not Respected by rush
#5076
Labels
effort: medium
Needs a somewhat experienced developer
help wanted
If you're looking to contribute, this issue is a good place to start!
Summary
Configuring Rush to use Bash as the script shell on Windows via the
.npmrc
setting (script-shell=bash
) does not work withrush
. Despite this configuration,rush
always defaults to usingcmd.exe
, whereasnpm run
correctly respects thescript-shell
setting.Reproduction Steps
script-shell=bash
to the.npmrc
file in the project root.package.json
:rushx
:npm run
:Expected Result
Both
rushx test-script
andnpm run test-script
should execute using Bash and outputbash
.Actual Result
npm run test-script
correctly uses Bash and outputsbash
.rushx test-script
usescmd.exe
and outputs$0
, ignoring thescript-shell
setting.Technical Details
It appears that
rushx
does not respect thescript-shell
configuration in.npmrc
, always defaulting to the system shell (cmd.exe
on Windows). This inconsistency withnpm run
may cause issues for projects relying on Unix-like shell behavior.Suggested Solution
Ensure that
rushx
checks and honors thescript-shell
setting from.npmrc
when executing scripts, aligning its behavior withnpm run
.Standard Questions
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: