Skip to content

Commit 1f88fa1

Browse files
committed
refactor: use while loop instead of mapfile as macOS in GitHub Actions does not have bash 4
1 parent 3eb3f83 commit 1f88fa1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/actions/pristine-homebrew/action.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,27 @@ runs:
5151
shell: bash
5252
run: |
5353
set -euo pipefail
54-
mapfile -t formulae < <(brew list --formula)
54+
55+
formulae=()
56+
while IFS= read -r f; do
57+
formulae+=("$f")
58+
done < <(brew list --formula)
5559
if [ "${#formulae[@]}" -gt 0 ]; then
5660
brew uninstall --zap --force "${formulae[@]}"
5761
fi
58-
mapfile -t casks < <(brew list --cask)
62+
63+
casks=()
64+
while IFS= read -r c; do
65+
casks+=("$c")
66+
done < <(brew list --cask)
5967
if [ "${#casks[@]}" -gt 0 ]; then
6068
brew uninstall --cask --zap --force "${casks[@]}"
6169
fi
62-
mapfile -t taps < <(brew tap)
70+
71+
taps=()
72+
while IFS= read -r t; do
73+
taps+=("$t")
74+
done < <(brew tap)
6375
if [ "${#taps[@]}" -gt 0 ]; then
6476
brew untap "${taps[@]}"
6577
fi

0 commit comments

Comments
 (0)