chore(hooks): enforce executable bit on claude.sh and build.sh via pre-commit hook

This commit is contained in:
docker-claude 2026-04-15 17:16:58 +02:00
parent 6a060aa8ab
commit f07a30bd0b
2 changed files with 21 additions and 0 deletions

View file

@ -52,6 +52,14 @@ cd /path/to/project && ./claude.sh start # start proxy + launch Claude (pulls i
./build.sh # build images locally (development) ./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 ## Coding Standards
- Shell scripts use `set -euo pipefail` - Shell scripts use `set -euo pipefail`

13
hooks/pre-commit Executable file
View file

@ -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