Skip to content

Commit

Permalink
Fix the NoRecursiveDirs cop to not fire on every single block
Browse files Browse the repository at this point in the history
Differential Revision: D52571033

fbshipit-source-id: 1b0a038f98c12d7f4ad4e298d5641651bdc97d03
  • Loading branch information
Olivier Raginel authored and facebook-github-bot committed Jan 9, 2024
1 parent 0b29627 commit 23d7669
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions itchef/cookbooks/cpe_remote/resources/zip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@
end
end

action :create do # rubocop:disable Chef/Meta/NoRecursiveDirs # ~FB019
action :create do
chef_cache = Chef::Config[:file_cache_path]
extra_loco = new_resource.extract_location.delete(':')
zip_path = ::File.join(
chef_cache, 'remote_zip', extra_loco, new_resource.zip_name
)

return unless node['cpe_remote']['server_accessible']
converge_if_changed do # rubocop:disable Chef/Meta/NoRecursiveDirs # ~FB019
converge_if_changed do
base_filename = ::File.basename(zip_path)
# @lint-ignore FBCHEFFoodcritic
directory ::File.dirname(zip_path) do # rubocop:disable Chef/Meta/RequireOwnerGroupMode, Chef/Meta/NoRecursiveDirs # ~FB019 ~FB024
recursive true
directory ::File.dirname(zip_path) do # rubocop:disable Chef/Meta/RequireOwnerGroupMode
recursive true # rubocop: disable Chef/Meta/NoRecursiveDirs
end

if node.windows?
Expand Down Expand Up @@ -140,9 +140,9 @@
end

# @lint-ignore FBCHEFFoodcritic
directory new_resource.extract_location do # rubocop:disable Chef/Meta/NoRecursiveDirs # ~FB019
directory new_resource.extract_location do
not_if { node.windows? }
recursive true
recursive true # rubocop:disable Chef/Meta/NoRecursiveDirs
mode new_resource.mode
owner new_resource.owner
group new_resource.group
Expand Down

0 comments on commit 23d7669

Please sign in to comment.