Skip to content

Commit 583fbe3

Browse files
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 <josh.t.richards@gmail.com> * chore(hooks): make skipped/completed logic more intuitive Signed-off-by: Josh <josh.t.richards@gmail.com> --------- Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent a5577bc commit 583fbe3

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

docker-entrypoint.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ run_path() {
3535
while read -r script_file_path; do
3636
if ! [ -x "${script_file_path}" ]; then
3737
echo "==> The script \"${script_file_path}\" was skipped, because it lacks the executable flag"
38-
found=$((found-1))
3938
continue
4039
fi
4140

@@ -49,10 +48,10 @@ run_path() {
4948

5049
echo "==> Finished executing the script: \"${script_file_path}\""
5150
done
52-
if [ "$found" -lt "1" ]; then
53-
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
51+
if [ "$found" -gt "0" ]; then
52+
echo "=> Completed executing scripts in the \"$1\" folder"
5453
else
55-
echo "=> Completed executing scripts in the \"$1\" folder"
54+
echo "==> Skipped: the \"$1\" folder does not contain any valid scripts"
5655
fi
5756
)
5857
}

0 commit comments

Comments
 (0)