summaryrefslogtreecommitdiff
path: root/lib/chef_zero/data_store/raw_file_store.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/data_store/raw_file_store.rb')
-rw-r--r--lib/chef_zero/data_store/raw_file_store.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef_zero/data_store/raw_file_store.rb b/lib/chef_zero/data_store/raw_file_store.rb
index 31bf08a..d643f03 100644
--- a/lib/chef_zero/data_store/raw_file_store.rb
+++ b/lib/chef_zero/data_store/raw_file_store.rb
@@ -44,6 +44,7 @@ module ChefZero
if destructible
Dir.entries(root).each do |entry|
next if entry == "." || entry == ".."
+
FileUtils.rm_rf(Path.join(root, entry))
end
end
@@ -110,9 +111,10 @@ module ChefZero
def delete_dir(path, *options)
if options.include?(:recursive)
- if !File.exist?(path_to(path))
+ unless File.exist?(path_to(path))
raise DataNotFoundError.new(path)
end
+
FileUtils.rm_rf(path_to(path))
else
begin