From 5d449cf34e659dfc21ef67fbc4a0dbc70718e904 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 28 Nov 2017 20:22:46 +0100 Subject: [PATCH] Fix external Cask commands. --- Library/Homebrew/cask/lib/hbc/cli.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index 215b59843d..e2deb6f671 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -113,9 +113,9 @@ module Hbc # other Ruby libraries must do everything via "require" klass.run(*args) end - elsif which("brewcask-#{command}") + elsif external_command = which("brewcask-#{command}", ENV["HOMEBREW_PATH"]) # arbitrary external executable on PATH, Homebrew-style - exec "brewcask-#{command}", *ARGV[1..-1] + exec external_command, *ARGV[1..-1] elsif Pathname.new(command.to_s).executable? && command.to_s.include?("/") && !command.to_s.match(/\.rb$/)