Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit d0c5c3d

Browse files
authored
Merge pull request #51 from boxen/use-boxen-install-for-casks
Use `boxen-install` for installing Casks
2 parents 30d2ba9 + 12ba082 commit d0c5c3d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/puppet/provider/package/brewcask.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,21 @@ def query
4545
end
4646

4747
def install
48-
run "install", resource[:name], *install_options
48+
if install_options.any?
49+
execute ["brew", "install", "Caskroom/cask/#{resource[:name]}", *install_options].flatten, command_opts
50+
else
51+
execute ["brew", "boxen-install", "Caskroom/cask/#{resource[:name]}"], command_opts
52+
end
4953
end
5054

5155
def uninstall
52-
run "uninstall", resource[:name]
56+
execute "brew", "uninstall", "--force", resource[:name]
5357
end
5458

5559
def install_options
5660
Array(resource[:install_options]).flatten.compact
5761
end
5862

59-
def run(*cmds)
60-
brew_cmd = ["brew", "cask"] + cmds
61-
execute brew_cmd, command_opts
62-
end
63-
6463
private
6564
# Override default `execute` to run super method in a clean
6665
# environment without Bundler, if Bundler is present

0 commit comments

Comments
 (0)