mirror of
				https://github.com/thoughtbot/shoulda-matchers.git
				synced 2022-11-09 12:01:38 -05:00 
			
		
		
		
	Update bin/setup to detect chruby installed from homebrew on M1 (#1483)
With Apple moving to M1, homebrew took the opportunity to change the install location from /usr/local to /opt/homebrew So check for /opt/homebrew in addition to /usr/local for a chruby.sh
This commit is contained in:
		
							parent
							
								
									4eb5bb0b35
								
							
						
					
					
						commit
						0a2bb55279
					
				
					 1 changed files with 12 additions and 1 deletions
				
			
		
							
								
								
									
										13
									
								
								bin/setup
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								bin/setup
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -228,7 +228,18 @@ ensure-ruby-installed() {
 | 
			
		|||
      rbenv install --skip-existing "$REQUIRED_RUBY_VERSION"
 | 
			
		||||
    fi
 | 
			
		||||
  elif has-executable chruby-exec; then
 | 
			
		||||
    PREFIX='' source /usr/local/share/chruby/chruby.sh
 | 
			
		||||
    if [ -f /usr/local/share/chruby/chruby.sh ]; then
 | 
			
		||||
      CHRUBY_SH=/usr/local/share/chruby/chruby.sh
 | 
			
		||||
    elif [ -f /opt/homebrew/share/chruby/chruby.sh ]; then
 | 
			
		||||
      CHRUBY_SH=/opt/homebrew/share/chruby/chruby.sh
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    if [ -z "$CHRUBY_SH" ]; then
 | 
			
		||||
      error "chruby-exec detected, but could not find chruby.sh for loading"
 | 
			
		||||
      exit 1
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    PREFIX='' source $CHRUBY_SH
 | 
			
		||||
    if ! (chruby '' | grep $REQUIRED_RUBY_VERSION'\>' &>/dev/null); then
 | 
			
		||||
      if has-executable install-ruby; then
 | 
			
		||||
        banner "Installing Ruby $REQUIRED_RUBY_VERSION with install-ruby"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue