Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
git-hook-template: Use case, which is less repetitive
Lorenz Leutgeb committed 22 days ago
commit e6ab7b8bbd33a69f115f6b4b186d7623d86f43aa
parent 2d99d41211c03a2aa710d38f924fa5878a083b79
1 file changed +9 -11
modified scripts/git-hook-template.sh
@@ -34,14 +34,12 @@ then
    esac
fi

-
# Execute the appropriate just recipe based on the hook name
-
if [ "$HOOK_NAME" = "pre-commit" ]; then
-
    just pre-commit
-
elif [ "$HOOK_NAME" = "pre-push" ]; then
-
    just pre-push
-
elif [ "$HOOK_NAME" = "post-checkout" ]; then
-
    just post-checkout
-
else
-
    echo "⚠️ Unknown hook: $HOOK_NAME"
-
    exit 1
-
fi
+
# Execute the appropriate just recipe based on the hook name.
+
case "$HOOK_NAME" in
+
    pre-commit | pre-push | post-checkout)
+
        just "$HOOK_NAME"
+
        ;;
+
    *)
+
        echo "⚠️ Unknown hook: $HOOK_NAME"
+
        exit 1
+
esac