From 913ea0e5e472c187445ba5acb616af49cd7b87c8 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Sun, 14 Jul 2024 22:57:56 -0400 Subject: [PATCH] abstract_command: fix `raise_sh_command_error!` not being found --- Library/Homebrew/abstract_command.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/abstract_command.rb b/Library/Homebrew/abstract_command.rb index 46c4e2b0e2..7bdc7b3907 100644 --- a/Library/Homebrew/abstract_command.rb +++ b/Library/Homebrew/abstract_command.rb @@ -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