Skip to content

fix: enforce LF line endings to unbreak hooks on macOS/Linux (#12) - #13

Merged
iammukeshm merged 1 commit into
mainfrom
fix/crlf-line-endings
Jun 27, 2026
Merged

fix: enforce LF line endings to unbreak hooks on macOS/Linux (#12)#13
iammukeshm merged 1 commit into
mainfrom
fix/crlf-line-endings

Conversation

@iammukeshm

Copy link
Copy Markdown
Member

Summary

Fixes #12. Hook scripts in hooks/ were committed with CRLF line endings, which breaks every hook on macOS/Linux — including the PreToolUse Bash guard, blocking all Bash tool calls while the plugin is installed.

Changes

  • Add .gitattributes enforcing eol=lf for all text files and *.sh specifically, while keeping CRLF for Windows-only scripts (*.bat, *.cmd, *.ps1) and marking binaries.
  • Renormalize all tracked files to LF in the index so existing CRLF files are fixed (not just future commits).

Verification

$ git ls-files --eol | grep 'i/crlf'   # → (none)
$ for f in hooks/*.sh; do bash -n "$f"; done   # → all OK

All hook scripts now pass bash -n, and no tracked file remains CRLF in the index.

🤖 Generated with Claude Code

Hook scripts were being delivered with CRLF line terminators, which
breaks every script on macOS/Linux — the PreToolUse Bash guard fails
with ": command not found" and "unexpected end of file", blocking all
Bash tool calls while the plugin is installed.

The committed blobs are actually LF, but this repo has core.autocrlf=true,
so on a Windows checkout the working tree is smudged to CRLF — and that
working tree is what ships. Adding .gitattributes with `eol=lf` forces LF
on checkout across every OS regardless of autocrlf, so the working tree
(and anything packaged from it) stays LF and can't regress.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@iammukeshm
iammukeshm merged commit cbad34a into main Jun 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hook scripts have CRLF line endings — breaks all Bash tool calls on macOS/Linux

1 participant