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