Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Griffin adamwgriffin

View GitHub Profile
@adamwgriffin
adamwgriffin / rmempty.rb
Created Apr 4, 2014
A one-liner to recursively delete empty directories with Ruby
View rmempty.rb
Dir['**/'].reverse_each { |d| Dir.rmdir d if Dir.entries(d).size == 2 }