diff options
author | Tim Smith <tsmith84@gmail.com> | 2021-02-05 20:45:08 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-02-05 20:45:08 -0800 |
commit | c757ef9030c54383a85bf100543694c121a0a1e2 (patch) | |
tree | 7cf971f1e3202caa0be7968beb30c6d5c21590aa | |
parent | 2fb7b07ab9cc8d9ef8b84c3b5b015d0aba6c9e01 (diff) | |
download | chef-c757ef9030c54383a85bf100543694c121a0a1e2.tar.gz |
Only create the cache dir but do it recursively
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/homebrew_install.rb | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/chef/resource/homebrew_install.rb b/lib/chef/resource/homebrew_install.rb index ccaf7376f6..c190bf7549 100644 --- a/lib/chef/resource/homebrew_install.rb +++ b/lib/chef/resource/homebrew_install.rb @@ -75,8 +75,6 @@ class Chef raise Chef::Exceptions::InsufficientPermissions, msg end - user_home = Dir.home(new_resource.user).freeze - # Creating the basic directory structure needed for Homebrew directories = ["bin", "etc", "include", "lib", "sbin", "share", "var", "opt", "share/zsh", "share/zsh/site-functions", @@ -92,16 +90,12 @@ class Chef end end - user_directories = ["#{user_home}", "#{user_home}/Library", - "#{user_home}/Library/Caches", "#{user_home}/Library/Caches/Homebrew" - ].freeze - user_directories.each do |dir| - directory "#{dir}" do - mode "0755" - owner new_resource.user - group "admin" - action :create - end + directory ::File.join(Dir.home(new_resource.user), "/Library/Caches/Homebrew") do + mode "0755" + owner new_resource.user + recursive true + group "admin" + action :create end if new_resource.xcode_tools_url @@ -159,4 +153,4 @@ class Chef end end end -end
\ No newline at end of file +end |