Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix bugs in uninstall and remove

  • Loading branch information...
commit 97853e84c8701b684fe750bbcd6b2ddcbb773a38 1 parent 271a10b
@vertiginous authored
View
2  lib/pik/commands/remove_command.rb
@@ -9,7 +9,7 @@ class Remove < Command
attr_reader :force, :quiet
def execute
- to_remove = config.match(@args.first)
+ to_remove = config.options.fetch(:remove, config.match(@args.shift))
raise QuitError unless to_remove
name, data = *to_remove
View
14 lib/pik/commands/uninstall_command.rb
@@ -10,22 +10,24 @@ class UnInstall < Command
def execute
to_remove = config.match(@args.first)
+ rm_name, rm_config = to_remove
unless to_remove
puts "Couldn't find the version you're looking for '#{@args.join(' ')}'."
raise QuitError
end
- if force || hl.agree("Are you sure you'd like to uninstall '#{to_remove}'?"){|answer| answer.default = 'yes' }
- puts "** Deleting #{config[to_remove][:path].dirname}"
- path = config[to_remove][:path].dirname
+ if force || hl.agree("Are you sure you'd like to uninstall '#{rm_name}'?"){|answer| answer.default = 'yes' }
+ Log.info "Deleting #{rm_config[:path].dirname}"
+ path = rm_config[:path].dirname
FileUtils.rm_rf(path) if path.exist?
- remove(to_remove)
+ remove(rm_name)
puts
- hl.say("#{to_remove} has been uninstalled.")
+ Log.info "#{rm_name} has been uninstalled."
end
end
def remove(to_remove)
- rm = Pik::Remove.new([to_remove, '--force', '--quiet'], config)
+ config.options[:remove] = to_remove
+ rm = Pik::Remove.new(['--force'], config)
rm.execute
rm.close
end
Please sign in to comment.
Something went wrong with that request. Please try again.