diff maid/general.rb @ 52:625fc94c8e62

Add maid rules
author zegervdv <zegervdv@me.com>
date Mon, 21 Apr 2014 16:47:17 +0200
parents 4253a2206527
children 1de663077957
line wrap: on
line diff
--- a/maid/general.rb	Tue May 13 21:53:54 2014 +0200
+++ b/maid/general.rb	Mon Apr 21 16:47:17 2014 +0200
@@ -20,7 +20,7 @@
   end
 
   rule 'Remove empty folders' do
-    trash(dir('~/Downloads/**/*').select { |path| File.directory?(path) && File.stat(path).size < 1.megabyte })
+    trash(dir('~/Downloads/**/*').select { |path| File.directory?(path) && (File.stat(path).size < 1.megabyte || dir("#{path}/*").empty? ) })
   end
 
   rule 'Remove old files' do