lib/rip/commands/install.rb in rip-0.0.2 vs lib/rip/commands/install.rb in rip-0.0.3
- old
+ new
@@ -17,23 +17,23 @@
if source.to_s.empty?
ui.abort "Please tell me what to install."
end
package = Rip::Package.for(source, version)
+ installed_package = manager.package(package.name)
if !package
ui.abort "I don't know how to install #{source}"
end
- if options[:f]
- Installer.new.uninstall(package) if package.installed?
+ if options[:f] && installed_package
+ Installer.new.uninstall(installed_package) if installed_package.installed?
Installer.new.install(package)
elsif package.installed?
ui.puts "#{package} already installed"
else
installer = Installer.new
installer.install(package)
-# puts "#{installer.installed.size.to_i} packages installed"
end
end
end
end