lib/xcode/install.rb in xcode-install-0.9.1 vs lib/xcode/install.rb in xcode-install-0.9.2
- old
+ new
@@ -69,11 +69,11 @@
@installed ||= installed.map { |x| InstalledXcode.new(x) }.sort do |a, b|
Gem::Version.new(a.version) <=> Gem::Version.new(b.version)
end
end
- def install_dmg(dmgPath, suffix = '', switch = true, clean = true)
+ def install_dmg(dmgPath, suffix = '', switch = true, clean = true, components = true)
xcode_path = "/Applications/Xcode#{suffix}.app"
`hdiutil mount -nobrowse -noverify #{dmgPath}`
puts 'Please authenticate for Xcode installation...'
source = Dir.glob('/Volumes/Xcode/Xcode*.app').first
@@ -90,11 +90,11 @@
`sudo ditto "#{source}" "#{xcode_path}"`
`umount "/Volumes/Xcode"`
enable_developer_mode
`sudo xcodebuild -license` unless xcode_license_approved?
- install_components(xcode_path)
+ install_components(xcode_path) if components
if switch
`sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil?
`sudo ln -sf #{xcode_path} #{SYMLINK_PATH}` unless SYMLINK_PATH.exist?
@@ -103,15 +103,16 @@
end
FileUtils.rm_f(dmgPath) if clean
end
- def install_version(version, switch = true, clean = true, install = true, progress = true)
+ def install_version(version, switch = true, clean = true, install = true, progress = true,
+ components = true)
return if version.nil?
dmg_path = get_dmg(version, progress)
fail Informative, "Failed to download Xcode #{version}." if dmg_path.nil?
- install_dmg(dmg_path, "-#{version.split(' ')[0]}", switch, clean) if install
+ install_dmg(dmg_path, "-#{version.split(' ')[0]}", switch, clean, components) if install
end
def list_current
stable_majors = list_versions.reject { |v| /beta/i =~ v }.map { |v| v.split('.')[0] }.map { |v| v.split(' ')[0] }
latest_stable_major = stable_majors.select { |v| v.length == 1 }.uniq.sort.last.to_i