Skip to content

Commit 648cfb4

Browse files
authored
fix(skills): pin *.sh to LF so scripts run in WSL (#30078)
## Summary - Pin `*.sh` to `eol=lf` in `.gitattributes`. - Without it, Windows clones with `core.autocrlf=true` rewrite `scripts/skills-sync.sh` to CRLF, and `bash` fails in WSL with `set: invalid option` and `$'\r': command not found`. Git Bash tolerated it; WSL did not. - Companion fix to the extension PR ([MetaMask/metamask-extension#42488](MetaMask/metamask-extension#42488)) and the upstream `.gitattributes` in Consensys/skills. ## Test plan - [ ] `git check-attr -a scripts/skills-sync.sh` reports `eol: lf` - [ ] Fresh clone on Windows/WSL keeps LF; `yarn skills` runs without `\r` errors - [ ] macOS/Linux: no diff after pull <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk change limited to git line-ending attributes; it only affects how `*.sh` files are checked out on Windows/WSL and should not impact runtime logic. > > **Overview** > Ensures `*.sh` files are always checked out with **LF** by adding `*.sh text eol=lf` to `.gitattributes`, preventing Windows `autocrlf` clones from rewriting scripts to CRLF and breaking execution in WSL. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 788deae. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent a9c779f commit 648cfb4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# Windows files should use crlf line endings
22
# https://help.github.com/articles/dealing-with-line-endings/
33
*.bat text eol=crlf
4+
5+
# Shell scripts must keep LF so they run in WSL on Windows.
6+
*.sh text eol=lf

0 commit comments

Comments
 (0)