chore(hooks): enforce executable bit on claude.sh and build.sh via pre-commit hook
This commit is contained in:
parent
6a060aa8ab
commit
f07a30bd0b
2 changed files with 21 additions and 0 deletions
|
|
@ -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`
|
||||
|
|
|
|||
13
hooks/pre-commit
Executable file
13
hooks/pre-commit
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue