Module: Dotbox::Actions
- Included in:
- File
- Defined in:
- lib/dotbox/actions.rb
Instance Method Summary collapse
Instance Method Details
#rm_empty_dir(path) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/dotbox/actions.rb', line 4 def rm_empty_dir(path) return nil if !::File.directory?(path) if (Dir.entries(path) - %w{. ..}).empty? FileUtils.rm_r path rm_empty_dir ::File.dirname(path) end end |