diff options
author | Tim Smith <tsmith@chef.io> | 2019-01-17 12:09:17 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-17 12:09:17 -0800 |
commit | 768c995962b5fd6ac2fad6b2bf99bb5b1b075e19 (patch) | |
tree | d82cf020f8ad503e5f7fe6f45c1d9ad1fe6eb63f | |
parent | 157ce30298f08f302dd95b94761507254fdecc4e (diff) | |
parent | 69106a0e8e508f7b6d491a38679b87765fc40e98 (diff) | |
download | chef-768c995962b5fd6ac2fad6b2bf99bb5b1b075e19.tar.gz |
Merge pull request #8123 from chef/cask
homebrew_cask / homebrew_tap: Properly use the cask_name and tap_name properties
-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)) |