Add ShellCommand module for shell command stubs
This commit is contained in:
parent
cb48a95bbd
commit
d611e3e0f9
@ -61,12 +61,5 @@ 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
|
||||
|
||||
18
Library/Homebrew/shell_command.rb
Normal file
18
Library/Homebrew/shell_command.rb
Normal file
@ -0,0 +1,18 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Homebrew
|
||||
module ShellCommand
|
||||
extend T::Helpers
|
||||
|
||||
requires_ancestor { AbstractCommand }
|
||||
|
||||
sig { void }
|
||||
def run
|
||||
sh_cmd_path = "#{self.class.dev_cmd? ? "dev-cmd" : "cmd"}/#{self.class.command_name}.sh"
|
||||
raise StandardError,
|
||||
"This command is just here for completions generation. " \
|
||||
"It's actually defined in `#{sh_cmd_path}` instead."
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user