Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Use case, which is less repetitive
Lorenz Leutgeb committed 24 days ago
commit a45567c3f0f068b34d7347bffaf425c834de98c2
parent de76e347700ed2e55fc806e5bb0d6e7afb54fc44
1 file changed +9 -11
modified scripts/git-hook-template.sh
@@ -33,14 +33,12 @@ if [ ${#CHANGED_FILES[@]} -gt 0 ]; 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