Skip to content

Commit

Permalink
Don't set installed_package until after we know we found something good
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Aug 13, 2009
1 parent 39c2968 commit 510f801
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rip/commands/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ def install(options = {}, source = nil, version = nil, *args)
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

installed_package = manager.package(package.name)

if options[:f] && installed_package
Installer.new.uninstall(installed_package) if installed_package.installed?
Installer.new.install(package)
Expand Down

0 comments on commit 510f801

Please sign in to comment.