script/install-precommit: write the hook through $hook (closes #139)
check / check (push) Successful in 23s

The script set hook and then repeated the path literally, so shellcheck
reported the variable as unused (SC2034).

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-15 12:59:05 +00:00
1 parent 02632a5682
commit badac32cd3
1 file changed
+2 -2
+2 -2
View File
@@ -8,8 +8,8 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
main() { main() {
cd "$ROOT" cd "$ROOT"
hook=".git/hooks/pre-commit" hook=".git/hooks/pre-commit"
printf '#!/bin/sh\nset -e\nscript/precommit\n' > .git/hooks/pre-commit printf '#!/bin/sh\nset -e\nscript/precommit\n' > "$hook"
chmod +x .git/hooks/pre-commit chmod +x "$hook"
echo "pre-commit hook installed: runs script/precommit" echo "pre-commit hook installed: runs script/precommit"
} }