mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
34 lines
968 B
Ruby
34 lines
968 B
Ruby
module Cask
|
|
class Cmd
|
|
class Install < AbstractCommand
|
|
option "--force", :force, false
|
|
option "--skip-cask-deps", :skip_cask_deps, false
|
|
|
|
def initialize(*)
|
|
super
|
|
raise CaskUnspecifiedError if args.empty?
|
|
end
|
|
|
|
def run
|
|
odie "Installing casks is supported only on macOS" unless OS.mac?
|
|
casks.each do |cask|
|
|
begin
|
|
Installer.new(cask, binaries: binaries?,
|
|
verbose: verbose?,
|
|
force: force?,
|
|
skip_cask_deps: skip_cask_deps?,
|
|
require_sha: require_sha?,
|
|
quarantine: quarantine?).install
|
|
rescue CaskAlreadyInstalledError => e
|
|
opoo e.message
|
|
end
|
|
end
|
|
end
|
|
|
|
def self.help
|
|
"installs the given Cask"
|
|
end
|
|
end
|
|
end
|
|
end
|