Skip to content

Instantly share code, notes, and snippets.

@venj
Created December 15, 2015 02:31
Show Gist options
  • Save venj/bd77088b0e8642dd4593 to your computer and use it in GitHub Desktop.
Save venj/bd77088b0e8642dd4593 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
BAD_FILES = ['@eaDir', 'Thumbs.db']
def transverse(dir)
cd dir do
Dir["*"].each do |d|
rm_rf d if BAD_FILES.include?(d)
next unless File.directory? d
transverse(d)
end
end
end
ARGV.each do |dir|
transverse(dir)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment