From 930441ae9a280bec9d88ccf017463e1f588235e5 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Thu, 18 Jan 2024 12:04:30 -0600 Subject: [PATCH] Adding enforcement exit code --- precommit-hooks/ensure-apps-are-short | 3 +++ 1 file changed, 3 insertions(+) diff --git a/precommit-hooks/ensure-apps-are-short b/precommit-hooks/ensure-apps-are-short index 905cdee..cda6f7d 100755 --- a/precommit-hooks/ensure-apps-are-short +++ b/precommit-hooks/ensure-apps-are-short @@ -2,8 +2,11 @@ # Webserver apps directory should be short -- apps that fail this category should become their own. +retcode=0 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. + retcode=1 fi done +exit $retcode