lib/invoker/power/setup.rb in invoker-1.5.6 vs lib/invoker/power/setup.rb in invoker-1.5.7

- old
+ new

@@ -9,13 +9,15 @@ selected_installer_klass = installer_klass selected_installer_klass.new(tld).install end def self.uninstall - power_config = Invoker::Power::Config.load_config - selected_installer_klass = installer_klass - selected_installer_klass.new(power_config.tld).uninstall_invoker + if Invoker::Power::Config.has_config? + power_config = Invoker::Power::Config.load_config + selected_installer_klass = installer_klass + selected_installer_klass.new(power_config.tld).uninstall_invoker + end end def self.installer_klass if Invoker.darwin? Invoker::Power::OsxSetup @@ -72,9 +74,10 @@ } config end def remove_resolver_file + return if resolver_file.nil? begin safe_remove_file(resolver_file) rescue Errno::EACCES Invoker::Logger.puts("Running uninstall requires root access, please rerun it with sudo".colorize(:red)) raise