summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorMatt Kulka <mkulka@parchment.com>2021-05-21 09:32:51 -0700
committerMatt Kulka <mkulka@parchment.com>2021-05-21 09:32:51 -0700
commit222a1d0b795a85349a1a48d3d1dbefcec4eb2925 (patch)
tree58faa6ac4820e78aa94a915cf7f486a6468b59da /lib/chef
parent3a5b225af9c28d5bdb828fa3a3ec6cab35c4d1d9 (diff)
downloadchef-222a1d0b795a85349a1a48d3d1dbefcec4eb2925.tar.gz
pass homebrew_path, owner props to homebrew_tap if installing cask
when `homebrew_cask` is used with a homebrew_path attribute, it will try to install homebrew/cask by default with default options. this can fail in instances of non-standard homebrew paths or for arm64 macs that dont use the default /usr/local installation path. so pass along homebrew_path and owner props to the cask install `homebrew_tap` resource. Signed-off-by: Matt Kulka <mkulka@parchment.com>
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/resource/homebrew_cask.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/chef/resource/homebrew_cask.rb b/lib/chef/resource/homebrew_cask.rb
index 540d21a79e..ccfea70708 100644
--- a/lib/chef/resource/homebrew_cask.rb
+++ b/lib/chef/resource/homebrew_cask.rb
@@ -54,7 +54,12 @@ class Chef
default: lazy { find_homebrew_username }
action :install, description: "Install an application that is packaged as a Homebrew cask." do
- homebrew_tap "homebrew/cask" if new_resource.install_cask
+ if new_resource.install_cask
+ homebrew_tap "homebrew/cask" do
+ homebrew_path new_resource.homebrew_path
+ owner new_resource.owner
+ end
+ end
unless casked?
converge_by("install cask #{new_resource.cask_name} #{new_resource.options}") do
@@ -67,7 +72,12 @@ class Chef
end
action :remove, description: "Remove an application that is packaged as a Homebrew cask." do
- homebrew_tap "homebrew/cask" if new_resource.install_cask
+ if new_resource.install_cask
+ homebrew_tap "homebrew/cask" do
+ homebrew_path new_resource.homebrew_path
+ owner new_resource.owner
+ end
+ end
if casked?
converge_by("uninstall cask #{new_resource.cask_name}") do