just: Check for file before removing in install-hooks

The `rm` command would fail if the hook did not exist.
First check for existence and then remove.
This commit is contained in:
Fintan Halpenny 2026-04-15 10:19:52 +01:00
parent a74befd2a7
commit 11e80d3094
1 changed files with 3 additions and 1 deletions

View File

@ -153,7 +153,9 @@ install-hooks:
#!/usr/bin/env bash
set -e
for hook in {{hooks}}; do
rm ".git/hooks/$hook"
if [ -f ".git/hooks/$hook" ]; then
rm ".git/hooks/$hook"
fi
cp {{hook-script}} ".git/hooks/$hook"
chmod +x ".git/hooks/$hook"
done