2024-09-10 05:40:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# A pre-commit hook to lint features.json if it is edited
|
|
|
|
|
|
|
|
# Check if any path contains 'features.json'
|
|
|
|
if git diff --cached --name-only | grep -q 'config/retrodeck/reference_lists/features.json'; then
|
|
|
|
# Run the linting script
|
|
|
|
echo "Linting config/retrodeck/reference_lists/features.json..."
|
|
|
|
if ! bash developer_toolbox/lint_features.json.sh; then
|
|
|
|
echo "Linting failed. Please fix the issues and try again."
|
|
|
|
exit 1 # Exit with a non-zero status to block the commit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2024-09-10 05:50:14 +00:00
|
|
|
# Lint Manifest
|
|
|
|
# if git diff --cached --name-only | grep -q 'net.retrodeck.retrodeck.yml'; then
|
|
|
|
# # Run the linting script
|
|
|
|
# echo "Linting net.retrodeck.retrodeck.yml..."
|
|
|
|
# if ! bash developer_toolbox/lint_manifest.sh; then
|
|
|
|
# echo "Linting failed. Please fix the issues and try again."
|
|
|
|
# exit 1 # Exit with a non-zero status to block the commit
|
|
|
|
# fi
|
|
|
|
# fi
|
|
|
|
|
2024-09-10 05:40:30 +00:00
|
|
|
# Continue with the commit if all checks passed
|
|
|
|
exit 0
|