diff --git a/lib/puppet/provider/package/brewcask.rb b/lib/puppet/provider/package/brewcask.rb index e5e9dae..84abd9f 100644 --- a/lib/puppet/provider/package/brewcask.rb +++ b/lib/puppet/provider/package/brewcask.rb @@ -45,22 +45,21 @@ def query end def install - run "install", resource[:name], *install_options + if install_options.any? + execute ["brew", "install", "Caskroom/cask/#{resource[:name]}", *install_options].flatten, command_opts + else + execute ["brew", "boxen-install", "Caskroom/cask/#{resource[:name]}"], command_opts + end end def uninstall - run "uninstall", resource[:name] + execute "brew", "uninstall", "--force", resource[:name] end def install_options Array(resource[:install_options]).flatten.compact end - def run(*cmds) - brew_cmd = ["brew", "cask"] + cmds - execute brew_cmd, command_opts - end - private # Override default `execute` to run super method in a clean # environment without Bundler, if Bundler is present