diff options
author | Tim Smith <tsmith@chef.io> | 2019-01-16 10:52:41 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2019-01-17 15:56:55 -0800 |
commit | ec34c38a748228fd3cc2a6c9b101b41c3b07ebc9 (patch) | |
tree | 9afad1ab3e9fe303d1cbf14ba216c66f3cdf3411 /lib | |
parent | da9d29cb242cc47316f70a88ad9e15d2aa6d0cb5 (diff) | |
download | chef-ec34c38a748228fd3cc2a6c9b101b41c3b07ebc9.tar.gz |
homebrew_cask / homebrew_tap: Properly use the cask_name and tap_name properties
If the name properties for these resources we used we'd entirely ignore them.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/resource/homebrew_cask.rb | 10 | ||||
-rw-r--r-- | lib/chef/resource/homebrew_tap.rb | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/lib/chef/resource/homebrew_cask.rb b/lib/chef/resource/homebrew_cask.rb index 71b40c55bf..5162228e36 100644 --- a/lib/chef/resource/homebrew_cask.rb +++ b/lib/chef/resource/homebrew_cask.rb @@ -58,8 +58,8 @@ class Chef homebrew_tap "caskroom/cask" if new_resource.install_cask unless casked? - converge_by("install cask #{new_resource.name} #{new_resource.options}") do - shell_out!("#{new_resource.homebrew_path} cask install #{new_resource.name} #{new_resource.options}", + converge_by("install cask #{new_resource.cask_name} #{new_resource.options}") do + shell_out!("#{new_resource.homebrew_path} cask install #{new_resource.cask_name} #{new_resource.options}", user: new_resource.owner, env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, cwd: ::Dir.home(new_resource.owner)) @@ -73,8 +73,8 @@ class Chef homebrew_tap "caskroom/cask" if new_resource.install_cask if casked? - converge_by("uninstall cask #{new_resource.name}") do - shell_out!("#{new_resource.homebrew_path} cask uninstall #{new_resource.name}", + converge_by("uninstall cask #{new_resource.cask_name}") do + shell_out!("#{new_resource.homebrew_path} cask uninstall #{new_resource.cask_name}", user: new_resource.owner, env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, cwd: ::Dir.home(new_resource.owner)) @@ -88,7 +88,7 @@ class Chef alias_method :action_uninstall, :action_remove def casked? - unscoped_name = new_resource.name.split("/").last + unscoped_name = new_resource.cask_name.split("/").last shell_out!('#{new_resource.homebrew_path} cask list 2>/dev/null', user: new_resource.owner, env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, diff --git a/lib/chef/resource/homebrew_tap.rb b/lib/chef/resource/homebrew_tap.rb index aff65685b7..9d880c565f 100644 --- a/lib/chef/resource/homebrew_tap.rb +++ b/lib/chef/resource/homebrew_tap.rb @@ -55,9 +55,9 @@ class Chef action :tap do description "Add a Homebrew tap." - unless tapped?(new_resource.name) - converge_by("tap #{new_resource.name}") do - shell_out!("#{new_resource.homebrew_path} tap #{new_resource.full ? '--full' : ''} #{new_resource.name} #{new_resource.url || ''}", + unless tapped?(new_resource.tap_name) + converge_by("tap #{new_resource.tap_name}") do + shell_out!("#{new_resource.homebrew_path} tap #{new_resource.full ? '--full' : ''} #{new_resource.tap_name} #{new_resource.url || ''}", user: new_resource.owner, env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, cwd: ::Dir.home(new_resource.owner)) @@ -68,9 +68,9 @@ class Chef action :untap do description "Remove a Homebrew tap." - if tapped?(new_resource.name) - converge_by("untap #{new_resource.name}") do - shell_out!("#{new_resource.homebrew_path} untap #{new_resource.name}", + if tapped?(new_resource.tap_name) + converge_by("untap #{new_resource.tap_name}") do + shell_out!("#{new_resource.homebrew_path} untap #{new_resource.tap_name}", user: new_resource.owner, env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, cwd: ::Dir.home(new_resource.owner)) |