aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli.rb')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb
index 215b59843..e2deb6f67 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$/)