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:
parent
a74befd2a7
commit
11e80d3094
4
justfile
4
justfile
|
|
@ -153,7 +153,9 @@ install-hooks:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
for hook in {{hooks}}; do
|
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"
|
cp {{hook-script}} ".git/hooks/$hook"
|
||||||
chmod +x ".git/hooks/$hook"
|
chmod +x ".git/hooks/$hook"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue