diff options
author | Tim Smith <tsmith84@gmail.com> | 2021-01-04 13:30:26 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-01-05 19:38:48 -0800 |
commit | 5181b3e425dcc752b19b0ec1a46e51c7252e576e (patch) | |
tree | 7a1ad5d31d8344720f8214ea5149c7c24064fe8c | |
parent | e18cb90f7db932bf57a786e8a40c7dedc95837d5 (diff) | |
download | chef-5181b3e425dcc752b19b0ec1a46e51c7252e576e.tar.gz |
Fix homebrew_cask for the new syntax
Also add a CI test for installing a small cask
Signed-off-by: Tim Smith <tsmith@chef.io>
-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) |