From 3c938dc216578beaa3ba81f87ada096f4c7781ad Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 23 Nov 2022 17:39:37 -0700 Subject: [PATCH] fixed unbound variable --- get-changed-paths.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index 9690618f..edf83b40 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -28,7 +28,8 @@ function dirname_max_depth() { local dir="$1" local dirs=($(echo "$dir" | tr "/" " ")) - local max_depth="${#dirs[@]}" + local max_depth=${#dirs[@]} + INPUT_DIR_NAMES_MAX_DEPTH="${INPUT_DIR_NAMES_MAX_DEPTH:-$max_depth}" if [[ -n "$INPUT_DIR_NAMES_MAX_DEPTH" && "$INPUT_DIR_NAMES_MAX_DEPTH" -lt "$max_depth" ]]; then max_depth="$INPUT_DIR_NAMES_MAX_DEPTH"