Add pre-commit hook to validate composer.json

This commit is contained in:
Zach Borboa
2023-07-01 03:55:43 -07:00
parent 62163d3822
commit 5f5b94871d
2 changed files with 32 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
list_of_files="${@}"
for file in $list_of_files; do
if [[ "${file}" == "composer.json" ]]; then
$(which composer) validate
exit "${?}"
else
echo "unsupported file: ${file}"
exit 1
fi
done
exit 0