mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-11-04 08:56:36 +07:00 
			
		
		
		
	Fix checking for existing php formula on macOS
This commit is contained in:
		@ -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';
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user