ensure_executable!: add opt_bin path to search

Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
William Woodruff 2024-04-18 11:11:26 -07:00
parent 03bf6cc431
commit 0f0dee42b4
No known key found for this signature in database

View File

@ -401,6 +401,9 @@ module Kernel
executable = [
which(name),
which(name, ORIGINAL_PATHS),
# We prefer the opt_bin path to a formula's executable over the prefix
# path where available, since the former is stable during upgrades.
HOMEBREW_PREFIX/"opt/#{formula_name}/bin/#{name}",
HOMEBREW_PREFIX/"bin/#{name}",
].compact.first
return executable if executable.exist?