2023-02-03 11:58:20 +00:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
main() {
|
2023-04-24 17:49:28 +00:00
|
|
|
failure=0
|
2023-02-03 11:58:20 +00:00
|
|
|
|
2023-04-24 17:49:28 +00:00
|
|
|
make sort > /dev/null 2>&1 || {
|
|
|
|
echo "Sort failed!"
|
|
|
|
((failure+=1))
|
|
|
|
}
|
|
|
|
make validate || {
|
|
|
|
echo "Validate failed!"
|
|
|
|
((failure+=1))
|
|
|
|
}
|
2023-02-03 11:58:20 +00:00
|
|
|
|
|
|
|
# Fail if any changes were made to the repo
|
|
|
|
if [[ -n "(git status --short)" ]]; then
|
2023-04-24 17:49:28 +00:00
|
|
|
echo "git status failed!"
|
|
|
|
((failure+=1))
|
2023-02-03 11:58:20 +00:00
|
|
|
fi
|
2023-04-24 17:49:28 +00:00
|
|
|
if [[ $failure -gt 0 ]]; then
|
|
|
|
echo "${failure} check(s) failed!"
|
2023-02-03 11:58:20 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
main "${@}"
|