fix: Use script-shell=bash for cross-platform with-shell-commands example#12436
Merged
anthonyshew merged 2 commits intovercel:mainfrom Mar 24, 2026
Merged
Conversation
Contributor
|
Someone is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Replaced Unix-only shell commands (mkdir -p, cat) with cross-platform |
Replace Unix-only shell commands with cross-platform Node.js equivalents:
- Replace `mkdir -p dist` with `node -e "require('fs').mkdirSync('dist',{recursive:true})"` in app-a and app-b
- Replace `cat output-file.txt` with `node -e "process.stdout.write(require('fs').readFileSync(...))"` in pkg-a and pkg-b
The with-shell-commands example uses Unix-only commands that are not available
in Windows cmd.exe, preventing users on Windows from running the example.
Fixes vercel#11205
2e3d335 to
524a5e3
Compare
…mple Revert inline node -e replacements and instead add .npmrc with script-shell=bash, which is the pattern used by Turborepo's own test suite. This preserves the original readable shell commands while ensuring they work on Windows via Git Bash.
anthonyshew
approved these changes
Mar 24, 2026
Contributor
anthonyshew
left a comment
There was a problem hiding this comment.
Hey, appreciate you pointing this out. We don't want to write raw Node.js scripts into these commands, when .npmrc offers a simplified way to handle this.
I've updated the PR so that the example includes a .npmrc.
github-actions bot
added a commit
that referenced
this pull request
Mar 25, 2026
## Release v2.8.21-canary.10 Versioned docs: https://v2-8-21-canary-10.turborepo.dev ### Changes - release(turborepo): 2.8.21-canary.9 (#12432) (`2e2f8c3`) - fix: Use script-shell=bash for cross-platform with-shell-commands example (#12436) (`d5c2192`) - docs: Add AI guide to sidebar navigation (#12438) (`021d288`) - docs: Move `experimentalObservability` into `futureFlags` section (#12439) (`85812cc`) - fix: Skip Unix domain sockets and other special files during file hashing (#12445) (`eb8f75e`) - fix: Preserve dedupePeers and unknown pnpm lockfile settings (#12443) (`1529b92`) Co-authored-by: Turbobot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
node -escript replacements.npmrcwithscript-shell=bashto ensure all shell commands (mkdir -p,cat,echo >) work on Windows via Git BashThis is the same pattern Turborepo's own test suite uses (
crates/turborepo/tests/common/setup.rs). It provides comprehensive cross-platform coverage without sacrificing readability or introducing fragile inline Node.js in a teaching example.Fixes #11205.