mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +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.
|
||||
get_brewed_php() {
|
||||
php_cellar="$brew_prefix"/Cellar/php
|
||||
if [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
|
||||
cellar="$brew_prefix"/Cellar
|
||||
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
|
||||
else
|
||||
echo 'false';
|
||||
|
Loading…
Reference in New Issue
Block a user