Skip to content

Commit fda23d1

Browse files
committed
fix: replace case with if/else inside $() for bash 3.2 compat
1 parent df42161 commit fda23d1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

phpvm.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2908,10 +2908,11 @@ phpvm_ls_remote() {
29082908
# List all php formulae from Homebrew
29092909
remote_versions=$(
29102910
brew formulae 2> /dev/null | command grep -E '^php(@[0-9]+\.[0-9]+)?$' | while IFS= read -r formula; do
2911-
case "$formula" in
2912-
php) printf '%s\n' "$(brew_php_major_minor 2> /dev/null || printf '%s\n' 'latest')" ;;
2913-
php@*) printf '%s\n' "${formula#php@}" ;;
2914-
esac
2911+
if [ "$formula" = "php" ]; then
2912+
printf '%s\n' "$(brew_php_major_minor 2> /dev/null || printf '%s\n' 'latest')"
2913+
else
2914+
printf '%s\n' "${formula#php@}"
2915+
fi
29152916
done | command sort -t. -k1,1n -k2,2n
29162917
)
29172918
;;

0 commit comments

Comments
 (0)