diff --git a/CLAUDE.md b/CLAUDE.md index e65c01c..876db89 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -52,6 +52,14 @@ cd /path/to/project && ./claude.sh start # start proxy + launch Claude (pulls i ./build.sh # build images locally (development) ``` +## Git Hooks + +A pre-commit hook lives in `hooks/` and enforces the executable bit on `claude.sh` and `build.sh`. Activate it once after cloning: + +```bash +git config core.hooksPath hooks +``` + ## Coding Standards - Shell scripts use `set -euo pipefail` diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..113d4ad --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Ensure control scripts stay executable. +set -euo pipefail + +SCRIPTS=(claude.sh build.sh) + +for f in "${SCRIPTS[@]}"; do + if [[ -f "$f" && ! -x "$f" ]]; then + echo "pre-commit: fixing missing executable bit on $f" + chmod +x "$f" + git add "$f" + fi +done