CLT.installed?: base result on version detection
CLT.installed? previously returned false if the user had outdated dev tools installed after a 10.9 upgrade, which was confusing to users.
This commit is contained in:
		
							parent
							
								
									b5e2996365
								
							
						
					
					
						commit
						3943a77832
					
				@ -172,18 +172,10 @@ module OS
 | 
			
		||||
      MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables"
 | 
			
		||||
      MAVERICKS_PKG_PATH = Pathname.new("/Library/Developer/CommandLineTools")
 | 
			
		||||
 | 
			
		||||
      # True if:
 | 
			
		||||
      #  - Xcode < 4.3 is installed. The tools are found under /usr.
 | 
			
		||||
      #  - The "Command Line Tools" package has been installed.
 | 
			
		||||
      #    For OS X < 10.9, the tools are found under /usr. 10.9 always
 | 
			
		||||
      #    includes tools there, which run the real tools inside Xcode on
 | 
			
		||||
      #    Xcode-only installs, so it's necessary to look elsewhere.
 | 
			
		||||
      # Returns true even if outdated tools are installed, e.g.
 | 
			
		||||
      # tools from Xcode 4.x on 10.9
 | 
			
		||||
      def installed?
 | 
			
		||||
        if MacOS.version < :mavericks
 | 
			
		||||
          usr_dev_tools?
 | 
			
		||||
        else
 | 
			
		||||
          mavericks_dev_tools?
 | 
			
		||||
        end
 | 
			
		||||
        !!detect_version
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def mavericks_dev_tools?
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user