From 5eb540406117045de12d97791d450073ca3b6746 Mon Sep 17 00:00:00 2001 From: tracer Date: Sun, 15 Feb 2026 23:13:37 +0100 Subject: [PATCH] refactor the update --- scripts/hooks/pre-commit | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/hooks/pre-commit b/scripts/hooks/pre-commit index 3f784c3..7f9dc2a 100644 --- a/scripts/hooks/pre-commit +++ b/scripts/hooks/pre-commit @@ -1,5 +1,8 @@ #!/usr/bin/env bash set -euo pipefail -# Fail fast if the database is unreachable. -php artisan version:fetch >/dev/null +# Keep commits possible when local DB is offline. +if ! php artisan version:fetch >/dev/null 2>&1; then + echo "pre-commit: skipped 'php artisan version:fetch' (database unreachable)." >&2 + echo "pre-commit: start MySQL and run it manually when needed." >&2 +fi