lib/xcode/install/install.rb in xcode-install-0.1.1 vs lib/xcode/install/install.rb in xcode-install-0.2.0
- old
+ new
@@ -20,14 +20,16 @@
@should_switch = argv.flag?('switch', true)
super
end
def validate!
+ return if @version.nil?
raise Informative, "Version #{@version} already installed." if @installer.installed?(@version)
raise Informative, "Version #{@version} doesn't exist." unless @installer.exist?(@version)
end
def run
+ return if @version.nil?
dmgPath = @installer.download(@version)
raise Informative, "Failed to download Xcode #{@version}." if dmgPath.nil?
@installer.install_dmg(dmgPath, "-#{@version.split(' ')[0]}", @should_switch, @should_clean)
end