X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/069e33163e0b09a7d647a98c2fde284a16a43b99..1cb6635911ae9d6feab1c8efc7d4c33380169cd5:/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 )