Skip to content

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

Closed
czhao-wings wants to merge 1 commit into
mainfrom
fix/post-swift-edit
Closed

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

Conversation

@czhao-wings

Copy link
Copy Markdown
Owner

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

Test plan

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

🤖 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>
@czhao-wings czhao-wings closed this May 4, 2026
@czhao-wings

Copy link
Copy Markdown
Owner Author

See this pr: keskinonur#3

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