feat(pre-commit): automate generation of service templates and OpenAPI documentation during pre-commit hook

This commit is contained in:
Andras Bacsai
2025-09-11 16:53:11 +02:00
parent 5b3b4bbc43
commit d9a54145ef

View File

@@ -4,6 +4,19 @@ if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then
exec </dev/tty exec </dev/tty
fi fi
# Generate service templates and OpenAPI documentation
echo "🔄 Generating service templates..."
php artisan generate:services
echo "📚 Generating OpenAPI documentation..."
php artisan generate:openapi
# Add the generated files to the commit
git add templates/service-templates*.json
git add openapi.json openapi.yaml
echo "✅ Generated files have been added to the commit"
# Get list of stashed PHP files # Get list of stashed PHP files
stashed_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.php') stashed_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')