mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Fix checking for existing php formula on macOS
This commit is contained in:
parent
91026460e4
commit
10c12b9377
@ -162,8 +162,11 @@ fix_dependencies() {
|
|||||||
|
|
||||||
# Function to get PHP version if it is already installed using Homebrew.
|
# Function to get PHP version if it is already installed using Homebrew.
|
||||||
get_brewed_php() {
|
get_brewed_php() {
|
||||||
php_cellar="$brew_prefix"/Cellar/php
|
cellar="$brew_prefix"/Cellar
|
||||||
if [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
|
php_cellar="$cellar"/php
|
||||||
|
if [ -d "$cellar" ] && ! [[ "$(find "$cellar" -maxdepth 1 -name "php@$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
|
||||||
|
php_semver | cut -c 1-3
|
||||||
|
elif [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
|
||||||
php_semver | cut -c 1-3
|
php_semver | cut -c 1-3
|
||||||
else
|
else
|
||||||
echo 'false';
|
echo 'false';
|
||||||
|
Loading…
Reference in New Issue
Block a user