abstract_command: fix raise_sh_command_error! not being found

This commit is contained in:
Ruoyu Zhong 2024-07-14 22:57:56 -04:00
parent 5987c5c1d0
commit 913ea0e5e4
No known key found for this signature in database

View File

@ -32,12 +32,6 @@ module Homebrew
.delete_suffix("-cmd")
end
sig { void }
def raise_sh_command_error!
raise StandardError, "This command is just here for completions generation. " \
"It's actually defined in `cmd/#{command_name}` instead."
end
# @return the AbstractCommand subclass associated with the brew CLI command name.
sig { params(name: String).returns(T.nilable(T.class_of(AbstractCommand))) }
def command(name) = subclasses.find { _1.command_name == name }
@ -67,5 +61,12 @@ module Homebrew
sig { abstract.void }
def run; end
sig { void }
def raise_sh_command_error!
raise StandardError,
"This command is just here for completions generation. " \
"It's actually defined in `cmd/#{self.class.command_name}.sh` instead."
end
end
end