fix(build): keep shell scripts LF so Windows checkouts do not break bash - #3010
Closed
windalser wants to merge 1 commit into
Closed
fix(build): keep shell scripts LF so Windows checkouts do not break bash#3010windalser wants to merge 1 commit into
windalser wants to merge 1 commit into
Conversation
With core.autocrlf=true (the Git for Windows default) every checkout rewrote *.sh with CRLF, so running them under Git Bash failed with `$'\r': command not found`. The repo had no .gitattributes at all. Scoped to *.sh deliberately: a `* text=auto` rule would renormalize the whole tree and invalidate every cargo/vite build cache. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
|
🤖 hey @windalser — thank you for this contribution. The diagnosis is right: with Closing this as superseded by #2943, which is landing a repo-wide |
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
The repo has no
.gitattributes. Withcore.autocrlf=true— the Git for Windowsdefault — every checkout rewrites
*.shwith CRLF, and running them under Git Bashthen fails with
$'\r': command not found. This breaks the scripts thatjustrecipes and the dev setup depend on (
scripts/instance-env.sh,scripts/seed-local-community.sh,deploy/compose/run.sh, and the rest), and itrecurs after every
checkout/pull, so a local fix does not hold.Adds a single rule pinning
*.shto LF.Deliberately not
* text=auto: that would renormalize the entire working tree(~2800 files here) and invalidate every cargo and vite build cache for anyone who
already has CRLF checked out. Scoping to
*.shfixes the files that actually breakand is a no-op on macOS and Linux.
Related issue
None found — searched open and closed issues and PRs for
gitattributes,CRLF,and
line endings.Testing
On Windows 11 with
core.autocrlf=true, before the change:After the change, same steps across every tracked
*.sh:git statusstays clean; no other file is touched.🤖 Generated with Claude Code