diff --git a/Library/Homebrew/cask/cmd/install.rb b/Library/Homebrew/cask/cmd/install.rb index 1a3cd870db..961662f7a7 100644 --- a/Library/Homebrew/cask/cmd/install.rb +++ b/Library/Homebrew/cask/cmd/install.rb @@ -2,6 +2,7 @@ # frozen_string_literal: true require "cask_dependent" +require "extend/os/cask/cmd/install" module Cask class Cmd @@ -68,8 +69,6 @@ module Cask zap: nil, dry_run: nil ) - # TODO: Refactor and move to extend/os - odie "Installing casks is supported only on macOS" unless OS.mac? # rubocop:disable Homebrew/MoveToExtendOS options = { verbose: verbose, diff --git a/Library/Homebrew/extend/os/cask/cmd/install.rb b/Library/Homebrew/extend/os/cask/cmd/install.rb new file mode 100644 index 0000000000..aeb209fac6 --- /dev/null +++ b/Library/Homebrew/extend/os/cask/cmd/install.rb @@ -0,0 +1,4 @@ +# typed: strict +# frozen_string_literal: true + +require "extend/os/linux/cask/cmd/install" if OS.linux? diff --git a/Library/Homebrew/extend/os/linux/cask/cmd/install.rb b/Library/Homebrew/extend/os/linux/cask/cmd/install.rb new file mode 100644 index 0000000000..201666f52a --- /dev/null +++ b/Library/Homebrew/extend/os/linux/cask/cmd/install.rb @@ -0,0 +1,29 @@ +# typed: false +# frozen_string_literal: true + +require "cask_dependent" + +module Cask + class Cmd + # Cask implementation of the `brew install` command. + # + # @api private + class Install < AbstractCommand + def self.install_casks( + _casks, + verbose: nil, + force: nil, + adopt: nil, + binaries: nil, + skip_cask_deps: nil, + require_sha: nil, + quarantine: nil, + quiet: nil, + zap: nil, + dry_run: nil + ) + odie "Installing casks is supported only on macOS" + end + end + end +end