3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-17 03:47:20 +00:00

fixed unbound variable

This commit is contained in:
Tonye Jack 2022-11-23 17:39:37 -07:00
parent 80e364a5d0
commit 3c938dc216

View file

@ -28,7 +28,8 @@ function dirname_max_depth() {
local dir="$1" local dir="$1"
local dirs=($(echo "$dir" | tr "/" " ")) 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 if [[ -n "$INPUT_DIR_NAMES_MAX_DEPTH" && "$INPUT_DIR_NAMES_MAX_DEPTH" -lt "$max_depth" ]]; then
max_depth="$INPUT_DIR_NAMES_MAX_DEPTH" max_depth="$INPUT_DIR_NAMES_MAX_DEPTH"