diff --git a/hooks/_common.sh b/hooks/_common.sh index 730848997..d6dbbb272 100644 --- a/hooks/_common.sh +++ b/hooks/_common.sh @@ -348,7 +348,9 @@ function common::per_dir_hook { local pids=() - mapfile -t dir_paths_unique < <(echo "${dir_paths[@]}" | tr ' ' '\n' | sort -u) + # shellcheck disable=SC2207 # More readable way + local -a dir_paths_unique=($(printf '%s\n' "${dir_paths[@]}" | sort -u)) + local length=${#dir_paths_unique[@]} local last_index=$((${#dir_paths_unique[@]} - 1))