lib/rip/commands/uninstall.rb in rip-0.0.1 vs lib/rip/commands/uninstall.rb in rip-0.0.2
- old
+ new
@@ -1,13 +1,20 @@
module Rip
module Commands
o 'rip uninstall PACKAGE [options]'
- x 'Uninstalls a single Rip package.'
+ x 'Uninstalls a single Rip package (or rip itself).'
x '-y removes the package no matter what.'
x '-d removes the package and its dependents.'
def uninstall(options = {}, name = nil, *args)
if name.to_s.empty?
ui.abort "Please tell me what to uninstall."
+ end
+
+ if name == 'rip' && !options[:y]
+ ui.abort "Are you sure you want to uninstall rip? Pass -y if so."
+ elsif name == 'rip' && options[:y]
+ require 'rip/setup'
+ return Rip::Setup.uninstall(true)
end
force = options[:y] || options[:d]
package = manager.package(name)