Skip to content

Commit 21f3cc1

Browse files
committed
git.hooks: fix case where src_hook doesn't exist
`readlink -f /nothing` exits with status 1, when then exists the install script.
1 parent f64a0c6 commit 21f3cc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/git-hooks.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ let
9393
# Iterate over all the hooks we know of
9494
for name in ${toString (filter (name: name != "enable") (attrNames cfg))}; do
9595
# Resolve all the symlinks
96-
src_hook=$(readlink -f "$source_hook_dir/$name")
97-
dst_hook=$(readlink -f "$target_hook_dir/$name")
96+
src_hook=$(readlink -f "$source_hook_dir/$name" || true)
97+
dst_hook=$(readlink -f "$target_hook_dir/$name" || true)
9898
9999
# If the hook hasn't changed, skip
100100
if [[ "$src_hook" == "$dst_hook" ]]; then

0 commit comments

Comments
 (0)