Merge pull request #14546 from hyuraku/apply-extend/os-to-cask-cmd-install

apply `extend/os` to `Cask::cmd::install#install_casks`
This commit is contained in:
Mike McQuaid 2023-02-07 15:23:10 +01:00 committed by GitHub
commit e98aa831d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 2 deletions

View File

@ -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,

View File

@ -0,0 +1,4 @@
# typed: strict
# frozen_string_literal: true
require "extend/os/linux/cask/cmd/install" if OS.linux?

View File

@ -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