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

Commit

Permalink
Merge pull request #51 from boxen/use-boxen-install-for-casks
Browse files Browse the repository at this point in the history
Use `boxen-install` for installing Casks
  • Loading branch information
jacobbednarz authored Mar 20, 2017
2 parents 30d2ba9 + 12ba082 commit d0c5c3d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/puppet/provider/package/brewcask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0c5c3d

Please sign in to comment.