Created
December 15, 2015 02:31
-
-
Save venj/bd77088b0e8642dd4593 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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