Merge pull request #17106 from woodruffw-forks/ww/upgrade-fix-attestation

ensure_executable!: add opt_bin path to search
This commit is contained in:
Mike McQuaid 2024-04-19 08:36:18 +01:00 committed by GitHub
commit 47c2c6deed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -401,6 +401,9 @@ module Kernel
executable = [ executable = [
which(name), which(name),
which(name, ORIGINAL_PATHS), 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}", HOMEBREW_PREFIX/"bin/#{name}",
].compact.first ].compact.first
return executable if executable.exist? return executable if executable.exist?