From ab51ddcc1b693d89da660fe38ef2bf9df13cc8c5 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 19 Sep 2013 17:04:59 -0400 Subject: [PATCH] do not try to clean directories that have already been removed --- lib/rscons.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rscons.rb b/lib/rscons.rb index 8a22bfb..4cc3efe 100644 --- a/lib/rscons.rb +++ b/lib/rscons.rb @@ -32,6 +32,7 @@ module Rscons end # remove all created directories if they are empty cache.directories.sort {|a, b| b.size <=> a.size}.each do |directory| + next unless File.directory?(directory) if (Dir.entries(directory) - ['.', '..']).empty? Dir.rmdir(directory) rescue nil end