Files
Kapisi/precommit-hooks/ensure-apps-are-short
T

13 lines
379 B
Bash
Raw Normal View History

2024-01-12 13:06:58 -06:00
#!/bin/bash
# Webserver apps directory should be short -- apps that fail this category should become their own.
2024-01-18 12:04:30 -06:00
retcode=0
2024-01-12 13:06:58 -06:00
for file in `find roles/WebServer/files/apps -type f`; do
if [[ $(wc -l "$file" | awk '{ print $1; }') -gt 10 ]]; then
echo "$file" is too long to be deployed as a mini-app under the WebServer role.
2024-01-18 12:04:30 -06:00
retcode=1
2024-01-12 13:06:58 -06:00
fi
done
2024-01-18 12:04:30 -06:00
exit $retcode