lib/utilities: fix `_bash-it-array-dedup()`

Use fewer subprocesses and newline-delimited not space-delimited.
pull/1933/head
John D Pell 2021-09-08 15:52:03 -07:00
parent fe102ff505
commit bf96d01b11
1 changed files with 2 additions and 1 deletions

View File

@ -55,7 +55,8 @@ _bash-it-array-contains-element() {
# Dedupe a simple array of words without spaces. # Dedupe a simple array of words without spaces.
_bash-it-array-dedup() { _bash-it-array-dedup() {
echo "$*" | tr ' ' '\n' | sort -u | tr '\n' ' ' local IFS=$'\n'
echo "$@" | tr ' ' '\n' | sort -u
} }
# Outputs a full path of the grep found on the filesystem # Outputs a full path of the grep found on the filesystem