script/install-precommit: write the hook through $hook (closes #139)
check / check (push) Successful in 1m41s
check / check (push) Successful in 1m41s
The script set hook and then repeated the path literally, so shellcheck reported the variable as unused (SC2034). Model: opus-5-5
This commit was merged in pull request #172.
This commit is contained in:
1 parent
02632a5682
commit
11245b85ca
1 file changed
+2
-2
@@ -8,8 +8,8 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
hook=".git/hooks/pre-commit"
|
||||
printf '#!/bin/sh\nset -e\nscript/precommit\n' > .git/hooks/pre-commit
|
||||
chmod +x .git/hooks/pre-commit
|
||||
printf '#!/bin/sh\nset -e\nscript/precommit\n' > "$hook"
|
||||
chmod +x "$hook"
|
||||
echo "pre-commit hook installed: runs script/precommit"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user