Skip to content

Instantly share code, notes, and snippets.

@workmad3
Forked from wjessop/gist:912859
Created April 10, 2011 23:47
Show Gist options
  • Save workmad3/912861 to your computer and use it in GitHub Desktop.
Save workmad3/912861 to your computer and use it in GitHub Desktop.
# dir is an array of dir entries, eg: ['ar', 'fe', '4a', 'c9']
def delete_empty_dirs(dir)
begin
Dir.rmdir File.join(self.base_storage_path, dir.join('/'))
dir.pop
delete_empty_dirs(dir) unless dir.empty?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment