From 009bd8397793937ac9220875791847f28cdf0274 Mon Sep 17 00:00:00 2001 From: Matteo Cherubini Date: Fri, 12 Jun 2026 16:06:50 +0200 Subject: [PATCH] fix(pre-commit): Enhance git-crypt check and simplify error output --- templates/pre-commit.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/pre-commit.sh b/templates/pre-commit.sh index de2fde4..27f5936 100644 --- a/templates/pre-commit.sh +++ b/templates/pre-commit.sh @@ -11,9 +11,8 @@ set -euo pipefail FAILED=0 # Verify git-crypt is initialized -if [[ ! -d ".git-crypt" ]]; then - printf "\n\033[0;31m[CRITICAL] git-crypt not initialized.\033[0m\n" - printf "Run 'git-crypt init' and 'make setup' before committing.\n" +if ! git-crypt status >/dev/null 2>&1; then + printf "\n[CRITICAL] git-crypt not initialized.\n" exit 1 fi