Undo changes to cask/cmd
This commit is contained in:
parent
0c533f27ba
commit
ccabd3318e
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: false
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "search"
|
require "search"
|
||||||
@ -40,12 +40,12 @@ module Cask
|
|||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def self.command_name
|
def self.command_name
|
||||||
@command_name ||= T.must(name).sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase
|
@command_name ||= name.sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def self.abstract?
|
def self.abstract?
|
||||||
T.must(name).split("::").fetch(-1).match?(/^Abstract[^a-z]/)
|
name.split("::").last.match?(/^Abstract[^a-z]/)
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
@ -58,6 +58,11 @@ module Cask
|
|||||||
parser.generate_help_text
|
parser.generate_help_text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(String) }
|
||||||
|
def self.short_description
|
||||||
|
description[/\A[^.]*\./]
|
||||||
|
end
|
||||||
|
|
||||||
def self.run(*args)
|
def self.run(*args)
|
||||||
new(*args).run
|
new(*args).run
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: false
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "utils/github/actions"
|
require "utils/github/actions"
|
||||||
@ -13,7 +13,6 @@ module Cask
|
|||||||
|
|
||||||
def self.parser
|
def self.parser
|
||||||
super do
|
super do
|
||||||
T.bind(self, Homebrew::CLI::Parser)
|
|
||||||
switch "--[no-]download",
|
switch "--[no-]download",
|
||||||
description: "Audit the downloaded file"
|
description: "Audit the downloaded file"
|
||||||
switch "--[no-]appcast",
|
switch "--[no-]appcast",
|
||||||
@ -45,7 +44,7 @@ module Cask
|
|||||||
end
|
end
|
||||||
casks = casks.map { |c| CaskLoader.load(c, config: Config.from_args(args)) }
|
casks = casks.map { |c| CaskLoader.load(c, config: Config.from_args(args)) }
|
||||||
any_named_args = casks.any?
|
any_named_args = casks.any?
|
||||||
casks = Cask.all if casks.empty?
|
casks = Cask.to_a if casks.empty?
|
||||||
|
|
||||||
results = self.class.audit_casks(
|
results = self.class.audit_casks(
|
||||||
*casks,
|
*casks,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: false
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
@ -11,7 +11,6 @@ module Cask
|
|||||||
|
|
||||||
def self.parser
|
def self.parser
|
||||||
super do
|
super do
|
||||||
T.bind(self, Homebrew::CLI::Parser)
|
|
||||||
switch "--force",
|
switch "--force",
|
||||||
description: "Force redownloading even if files already exist in local cache."
|
description: "Force redownloading even if files already exist in local cache."
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: false
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cask_dependent"
|
require "cask_dependent"
|
||||||
@ -27,7 +27,6 @@ module Cask
|
|||||||
|
|
||||||
def self.parser(&block)
|
def self.parser(&block)
|
||||||
super do
|
super do
|
||||||
T.bind(self, Homebrew::CLI::Parser)
|
|
||||||
switch "--force",
|
switch "--force",
|
||||||
description: "Force overwriting existing files."
|
description: "Force overwriting existing files."
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: false
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
@ -11,7 +11,6 @@ module Cask
|
|||||||
|
|
||||||
def self.parser
|
def self.parser
|
||||||
super do
|
super do
|
||||||
T.bind(self, Homebrew::CLI::Parser)
|
|
||||||
switch "--force",
|
switch "--force",
|
||||||
description: "Uninstall even if the <cask> is not installed, overwrite " \
|
description: "Uninstall even if the <cask> is not installed, overwrite " \
|
||||||
"existing files and ignore errors when removing files."
|
"existing files and ignore errors when removing files."
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: false
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "env_config"
|
require "env_config"
|
||||||
@ -30,7 +30,6 @@ module Cask
|
|||||||
sig { returns(Homebrew::CLI::Parser) }
|
sig { returns(Homebrew::CLI::Parser) }
|
||||||
def self.parser
|
def self.parser
|
||||||
super do
|
super do
|
||||||
T.bind(self, Homebrew::CLI::Parser)
|
|
||||||
switch "--force",
|
switch "--force",
|
||||||
description: "Force overwriting existing files."
|
description: "Force overwriting existing files."
|
||||||
switch "--dry-run",
|
switch "--dry-run",
|
||||||
@ -177,9 +176,7 @@ module Cask
|
|||||||
|
|
||||||
return true if caught_exceptions.empty?
|
return true if caught_exceptions.empty?
|
||||||
raise MultipleCaskErrors, caught_exceptions if caught_exceptions.count > 1
|
raise MultipleCaskErrors, caught_exceptions if caught_exceptions.count > 1
|
||||||
raise caught_exceptions.fetch(0) if caught_exceptions.count == 1
|
raise caught_exceptions.first if caught_exceptions.count == 1
|
||||||
|
|
||||||
false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.upgrade_cask(
|
def self.upgrade_cask(
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: false
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
@ -11,7 +11,6 @@ module Cask
|
|||||||
|
|
||||||
def self.parser
|
def self.parser
|
||||||
super do
|
super do
|
||||||
T.bind(self, Homebrew::CLI::Parser)
|
|
||||||
switch "--force",
|
switch "--force",
|
||||||
description: "Ignore errors when removing files."
|
description: "Ignore errors when removing files."
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user