Skip to content

Commit

Permalink
Merge pull request #7367 from rolandwalker/remove_uninstall_files
Browse files Browse the repository at this point in the history
DSL remove support for old form `uninstall :files`
  • Loading branch information
ndr committed Nov 16, 2014
2 parents c418c55 + 65c81d2 commit 69df514
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/cask/artifact/uninstall_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
ohai "Running #{stanza} process for #{@cask}; your password may be necessary"

directives_set.each do |directives|
# todo remove backward-compatible :files
unknown_keys = directives.keys - [:early_script, :launchctl, :quit, :signal, :kext, :script, :pkgutil, :files, :delete, :trash, :rmdir]
unknown_keys = directives.keys - [:early_script, :launchctl, :quit, :signal, :kext, :script, :pkgutil, :delete, :trash, :rmdir]
unless unknown_keys.empty?
opoo %Q{Unknown arguments to #{stanza} -- #{unknown_keys.inspect}. Running "brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup" will likely fix it.}
end
Expand Down Expand Up @@ -308,17 +307,6 @@ def dispatch_uninstall_directives(stanza, expand_tilde=false)
end
end

# todo: remove support for deprecated :files both here and elsewhere
directives_set.select{ |h| h.key?(:files) }.each do |directives|
Array(directives[:files]).flatten.each_slice(PATH_ARG_SLICE_SIZE) do |path_slice|
ohai "Removing files: #{path_slice.utf8_inspect}"
path_slice = self.class.expand_path_strings(path_slice) if expand_tilde
path_slice = self.class.remove_relative_path_strings(:delete, path_slice) # :delete for messages
path_slice = self.class.remove_undeletable_path_strings(:delete, path_slice)
@command.run!('/bin/rm', :args => path_slice.unshift('-rf', '--'), :sudo => true)
end
end

directives_set.select{ |h| h.key?(:rmdir) }.each do |directives|
Array(directives[:rmdir]).flatten.each do |directory|
directory = self.class.expand_path_strings([directory]).first if expand_tilde
Expand Down

0 comments on commit 69df514

Please sign in to comment.