diff options
author | Tim Smith <tsmith@chef.io> | 2019-01-16 10:52:41 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2019-01-16 10:52:41 -0800 |
commit | 69106a0e8e508f7b6d491a38679b87765fc40e98 (patch) | |
tree | eeca57d7a2485c795515b72254f252279ffda4dc | |
parent | c86f10dfb9c898874a58cff92804ef437e3e8e98 (diff) | |
download | chef-cask.tar.gz |
homebrew_cask / homebrew_tap: Properly use the cask_name and tap_name propertiescask
If the name properties for these resources we used we'd entirely ignore them.
Signed-off-by: Tim Smith <tsmith@chef.io>
-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 a22d73aace..2b0478f826 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)) |