chore: bash 3.2-safe pre-commit; document hooksPath + gdtoolkit setup.

pull/149/head
VinPropane 2026-05-31 19:43:53 -04:00
parent 4379e42106
commit e93fb22f1a
2 changed files with 5 additions and 2 deletions

View File

@ -338,7 +338,7 @@ On **Linux** (including GitHub Actions), the path must be **`gdUnit4`** with a c
**Dev (NEO-18):** **`dev_toggle_occluder_obstacle`** (default **Ctrl+Shift+K**) toggles the prototype `Obstacle` visibility/collision in **`main.gd`**. **F9** / **F10** are used by the embedded debugger; use this action instead when the game is running in the editor. **Dev (NEO-18):** **`dev_toggle_occluder_obstacle`** (default **Ctrl+Shift+K**) toggles the prototype `Obstacle` visibility/collision in **`main.gd`**. **F9** / **F10** are used by the embedded debugger; use this action instead when the game is running in the editor.
**Git hooks (recommended):** configure hooks from the repo root (once per clone). This sets **`core.hooksPath=scripts/git-hooks`** so Git runs the tracked hooks directly (no copy under `.git/hooks`): **Git hooks (recommended):** configure hooks from the repo root (once per clone). This sets **`core.hooksPath=scripts/git-hooks`** so Git runs the tracked **`pre-commit`** / **`pre-push`** scripts (bash 3.2+ compatible):
```bash ```bash
./scripts/install-git-hooks.sh ./scripts/install-git-hooks.sh

View File

@ -4,7 +4,10 @@ set -euo pipefail
repo_root="$(git rev-parse --show-toplevel)" repo_root="$(git rev-parse --show-toplevel)"
cd "$repo_root" cd "$repo_root"
mapfile -t staged_files < <(git diff --cached --name-only --diff-filter=ACMR) staged_files=()
while IFS= read -r f; do
staged_files+=("$f")
done < <(git diff --cached --name-only --diff-filter=ACMR)
if [[ ${#staged_files[@]} -eq 0 ]]; then if [[ ${#staged_files[@]} -eq 0 ]]; then
exit 0 exit 0
fi fi