Skip to content

Commit

Permalink
Merge pull request #627 from antonbabenko/quickfix/replace_mapfile
Browse files Browse the repository at this point in the history
fix: Replace `mapfile` to support Bash 3.2.57 pre-installed in macOS
  • Loading branch information
yermulnik committed Feb 19, 2024
2 parents 8056513 + 2e14c16 commit 7147861
Showing 1 changed file with 3 additions and 1 deletion.
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 # 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))

Expand Down

0 comments on commit 7147861

Please sign in to comment.