Skip to content

Instantly share code, notes, and snippets.

@dakatsuka
Created May 8, 2015 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakatsuka/907b07bf7e236f193cd0 to your computer and use it in GitHub Desktop.
Save dakatsuka/907b07bf7e236f193cd0 to your computer and use it in GitHub Desktop.
class Specinfra::Command::Darwin::Base::Package
class << self
def check_is_installed_homebrew_cask(package, version=nil)
escaped_package = escape(package)
if version
"/usr/local/bin/brew cask info #{escaped_package} | grep -E '^#{package}: #{escape(version)}'"
else
"/usr/local/bin/brew cask list -1 | grep -E '^#{escaped_package}$'"
end
end
alias :check_is_installed_by_homebrew_cask :check_is_installed_homebrew_cask
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment