Skip to content

fix: read stdin explicitly in post-swift-edit.sh hook example#3

Open
czhao-wings wants to merge 1 commit intokeskinonur:mainfrom
czhao-wings:fix/post-swift-edit
Open

fix: read stdin explicitly in post-swift-edit.sh hook example#3
czhao-wings wants to merge 1 commit intokeskinonur:mainfrom
czhao-wings:fix/post-swift-edit

Conversation

@czhao-wings
Copy link
Copy Markdown

Summary

  • The post-swift-edit.sh hook example was missing < /dev/stdin on the jq call
  • Without it, jq hangs waiting for input instead of reading the JSON piped by Claude Code
  • Matches the pattern already used correctly in the file-protection.sh example in the same section

Test plan

  • Verify the hook example in README.md now reads FILE=$(jq -r '.tool_input.file_path // empty' < /dev/stdin)
  • Confirm it is consistent with the file-protection.sh hook example below it

🤖 Generated with Claude Code

Without `< /dev/stdin`, jq hangs waiting for input instead of reading
the JSON piped by Claude Code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant