Move Args#only_formula_or_cask to extend/os/linux

This commit is contained in:
apainintheneck 2022-10-03 18:13:33 -07:00
parent a178fc6a88
commit 6301de9dcc
3 changed files with 23 additions and 1 deletions

View File

@ -96,7 +96,6 @@ module Homebrew
end
def only_formula_or_cask
return :formula if OS.linux? && !Homebrew::EnvConfig.developer?
return :formula if formula? && !cask?
return :cask if cask? && !formula?
end
@ -153,3 +152,5 @@ module Homebrew
end
end
end
require "extend/os/args"

View File

@ -0,0 +1,4 @@
# typed: false
# frozen_string_literal: true
require "extend/os/linux/args" if OS.linux?

View File

@ -0,0 +1,17 @@
# typed: false
# frozen_string_literal: true
module Homebrew
module CLI
class Args
undef only_formula_or_cask
def only_formula_or_cask
# Make formula the default on linux for non-developers
return :formula unless Homebrew::EnvConfig.developer?
return :formula if formula? && !cask?
return :cask if cask? && !formula?
end
end
end
end