diff options
author | Tim Smith <tsmith@chef.io> | 2021-01-05 19:54:06 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 19:54:06 -0800 |
commit | e7c996122c9bc3d2ff91fdef478962eb04bf632a (patch) | |
tree | 0c9e28dd5d2be36e71f39532cfbfdda37bd52732 | |
parent | 782348af9ffb9c2e05d9dfa3b5f02db850f7153c (diff) | |
parent | 5181b3e425dcc752b19b0ec1a46e51c7252e576e (diff) | |
download | chef-e7c996122c9bc3d2ff91fdef478962eb04bf632a.tar.gz |
Merge pull request #10845 from chef/homebrew_backport_15
Fix homebrew_cask for the new syntax
-rw-r--r-- | lib/chef/resource/homebrew_cask.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/resource/homebrew_cask.rb b/lib/chef/resource/homebrew_cask.rb index 3842d96aaf..d356030719 100644 --- a/lib/chef/resource/homebrew_cask.rb +++ b/lib/chef/resource/homebrew_cask.rb @@ -59,7 +59,7 @@ class Chef unless casked? 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}", + shell_out!("#{new_resource.homebrew_path} install --cask #{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)) @@ -74,7 +74,7 @@ class Chef if casked? converge_by("uninstall cask #{new_resource.cask_name}") do - shell_out!("#{new_resource.homebrew_path} cask uninstall #{new_resource.cask_name}", + shell_out!("#{new_resource.homebrew_path} uninstall --cask #{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)) @@ -92,7 +92,7 @@ class Chef # @return [Boolean] def casked? unscoped_name = new_resource.cask_name.split("/").last - shell_out!("#{new_resource.homebrew_path} cask list 2>/dev/null", + shell_out!("#{new_resource.homebrew_path} list --cask 2>/dev/null", user: new_resource.owner, env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, cwd: ::Dir.home(new_resource.owner)).stdout.split.include?(unscoped_name) |