Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Replace mapfile to support Bash 3.2.57 pre-installed in macOS #627

Merged
merged 8 commits into from
Feb 19, 2024
4 changes: 3 additions & 1 deletion hooks/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
MaxymVlasov marked this conversation as resolved.
Show resolved Hide resolved
local -a dir_paths_unique=( $(printf '%s\n' "${dir_paths[@]}" | sort -u) )
yermulnik marked this conversation as resolved.
Show resolved Hide resolved

local length=${#dir_paths_unique[@]}
local last_index=$((${#dir_paths_unique[@]} - 1))

Expand Down
Loading