From 11e80d309412b06d460280cac5a1619dae6bfafb Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Wed, 15 Apr 2026 10:19:52 +0100 Subject: [PATCH] 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. --- justfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 70a6c4eb..a1d8bcf5 100644 --- a/justfile +++ b/justfile @@ -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