Class: Lunchy

Inherits:
Object
  • Object
show all
Defined in:
lib/masquito/install.rb

Constant Summary collapse

CONFIG =
{ :verbose => false, :write => nil }

Instance Method Summary collapse

Instance Method Details

#uninstall(params) ⇒ Object

Raises:

  • (ArgumentError)


82
83
84
85
86
87
88
89
90
91
# File 'lib/masquito/install.rb', line 82

def uninstall(params)
  raise ArgumentError, "uninstall [file]" if params.empty?
  filename = params[0]
  %w(~/Library/LaunchAgents /Library/LaunchAgents).each do |dir|
    if File.exist?(File.expand_path(dir))
      FileUtils.rm_rf(File.join(File.expand_path(dir), File.basename(filename)))
      return puts "#{filename} uninstalled from #{dir}"
    end
  end
end