Skip to content

Commit 1bcc55c

Browse files
author
Marlosoft
committed
Fix php version listing
1 parent fb4c3cd commit 1bcc55c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

php-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
declare -a php_versions
44

55
version=$(php -v | grep -o -e "PHP [0-9+]\.[0-9+]" | cut -d " " -f2)
6-
php_versions=($(brew ls --versions | grep -e "^php" | cut -d " " -f2 | grep -o -e "[0-9+]\.[0-9+]" | xargs))
6+
php_versions=($(brew ls --versions | egrep "^php(\ |@)" | cut -d " " -f2 | grep -o -e "[0-9+]\.[0-9+]" | xargs))
77

88
if [ -z "$1" ]; then
99
php_versions=$(printf ", %s" "${php_versions[@]}")
1010

11-
echo "Usage: $0 <version>"
11+
echo "Usage: $(basename $0) <version>"
1212
echo "PHP Versions: ${php_versions:2}"
1313
exit 0
1414
fi

0 commit comments

Comments
 (0)