From 802d7de8e86f0945fa32e05d31120f0509605e8a Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 25 Jul 2018 09:38:14 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20rescue=20`NameError`=20for=20`#?= =?UTF-8?q?run`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Homebrew/cask/lib/hbc/cli.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index a3864b008b..f1a673faed 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -103,12 +103,14 @@ module Hbc if external_ruby_cmd require external_ruby_cmd - begin - return const_get(command.to_s.capitalize.to_sym)&.run(*args) + klass = begin + const_get(command.to_s.capitalize.to_sym) rescue NameError # External command is a stand-alone Ruby script. return end + + return klass.run(*args) end if external_command = which("brewcask-#{command}", path)