X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/069e33163e0b09a7d647a98c2fde284a16a43b99..a6a29b80186ece7013cc283172cc56ca93e8cf67:/cookbooks/chef/libraries/remote_directory.rb diff --git a/cookbooks/chef/libraries/remote_directory.rb b/cookbooks/chef/libraries/remote_directory.rb index 730535d44..959eb2940 100644 --- a/cookbooks/chef/libraries/remote_directory.rb +++ b/cookbooks/chef/libraries/remote_directory.rb @@ -15,7 +15,7 @@ class Chef return unless @new_resource.purge files_to_purge = Set.new( - Dir.glob(::File.join(@new_resource.path, '**', '*'), ::File::FNM_DOTMATCH).select do |name| + Dir.glob(::File.join(@new_resource.path, "**", "*"), ::File::FNM_DOTMATCH).select do |name| name !~ /(?:^|#{Regexp.escape(::File::SEPARATOR)})\.\.?$/ end )