Merge pull request #4547 from reitermarkus/fix-name_error
Don’t rescue `NameError` for `#run`.
This commit is contained in:
commit
a1f0ff4322
@ -103,12 +103,14 @@ module Hbc
|
|||||||
if external_ruby_cmd
|
if external_ruby_cmd
|
||||||
require external_ruby_cmd
|
require external_ruby_cmd
|
||||||
|
|
||||||
begin
|
klass = begin
|
||||||
return const_get(command.to_s.capitalize.to_sym)&.run(*args)
|
const_get(command.to_s.capitalize.to_sym)
|
||||||
rescue NameError
|
rescue NameError
|
||||||
# External command is a stand-alone Ruby script.
|
# External command is a stand-alone Ruby script.
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return klass.run(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
if external_command = which("brewcask-#{command}", path)
|
if external_command = which("brewcask-#{command}", path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user