Skip to content

Commit

Permalink
refactor: silence shfmt's griping
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbowes committed Feb 19, 2024
1 parent da96f03 commit 2855eda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hooks/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,12 @@ function common::per_dir_hook {

local pids=()

local -a dir_paths_unique
# Note: This can break if any elements of dir_path contain glob characters.
# However, all elements of dir_path are generated from the output of dirname
# Which means all glob characters will already have been expanded.
# shellcheck disable=SC2207 # Can't use mapfile in bash 3
IFS=$'\n' local -a dir_paths_unique=($(sort -u <<<"${dir_paths[*]}"))
IFS=$'\n' dir_paths_unique=($(sort -u <<< "${dir_paths[*]}"))
unset IFS

local length=${#dir_paths_unique[@]}
Expand Down

0 comments on commit 2855eda

Please sign in to comment.