From 583fbe383cedb716c7e8483e03b4d476992c6a7e Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 28 Mar 2026 20:16:56 -0400 Subject: [PATCH] fix(hooks): incorrect found count/skipped output in mixed exec/non-exec batches (#2551) * fix(hooks): incorrect skipped output in mixed exec/non-exec batches The `found` variable is incorrectly decremented for non-executable scripts, which leads to misleading output when a hook folder contains an executable + a non-executable script (output will indicate the folder was fully scripted). Signed-off-by: Josh * chore(hooks): make skipped/completed logic more intuitive Signed-off-by: Josh --------- Signed-off-by: Josh --- docker-entrypoint.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4fc363f3..d8d21c1f 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -35,7 +35,6 @@ run_path() { while read -r script_file_path; do if ! [ -x "${script_file_path}" ]; then echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag" - found=$((found-1)) continue fi @@ -49,10 +48,10 @@ run_path() { echo "==> Finished executing the script: \"${script_file_path}\"" done - if [ "$found" -lt "1" ]; then - echo "==> Skipped: the \"$1\" folder does not contain any valid scripts" + if [ "$found" -gt "0" ]; then + echo "=> Completed executing scripts in the \"$1\" folder" else - echo "=> Completed executing scripts in the \"$1\" folder" + echo "==> Skipped: the \"$1\" folder does not contain any valid scripts" fi ) }