From f07a30bd0b9604d29aea68c3df0150761d5692a1 Mon Sep 17 00:00:00 2001 From: docker-claude Date: Wed, 15 Apr 2026 17:16:58 +0200 Subject: [PATCH] chore(hooks): enforce executable bit on claude.sh and build.sh via pre-commit hook --- CLAUDE.md | 8 ++++++++ hooks/pre-commit | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 hooks/pre-commit 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