homebrew-cask-versions/lib/cask/cli/install.rb
Roland Walker 216444849e Add copious debugging with --debug
- add new file "cask/utils.rb" analogous to "utils.rb" in Homebrew
- define odebug and odumpcask, analogs of ohai and friends, but
  which only give output when --debug is in effect
- move the debug setting from an instance variable in Cask::CLI
  to a method Cask.debug, defined in "lib/cask/options.rb", which
  was added in #2276. (Perhaps options.rb should be merged back
  into Cask::CLI).
- sprinkle odebug statements liberally throughout the codebase
- update tests
2014-01-28 10:15:43 -05:00

16 lines
430 B
Ruby

class Cask::CLI::Install
def self.run(*args)
raise CaskUnspecifiedError if args.empty?
cask_names = args.reject { |a| a.chars.first == '-' }
force = args.include? '--force'
cask_names.each do |cask_name|
odebug "Installing Cask #{cask_name}"
cask = Cask.load(cask_name)
Cask::Installer.new(cask).install(force)
end
end
def self.help
"installs the cask of the given name"
end
end