package/scripts/postinstall: add Homebrew to PATH.

This is automatic for `/usr/local/bin/brew` but let's do it manually
for `/opt/homebrew/bin/brew` too.
This commit is contained in:
Mike McQuaid 2025-06-23 15:16:49 +01:00
parent a6b1d42488
commit a9faa2cd8e
No known key found for this signature in database

View File

@ -93,3 +93,12 @@ mkdir -vp "${user_api_cache_dir}"
mv -v "${homebrew_directory}/cache_api/"* "${user_api_cache_dir}"
chown -R "${homebrew_pkg_user}:staff" "${user_cache_dir}"
rm -vrf "${homebrew_directory}/cache_api"
# create paths.d file for /opt/homebrew installs
# (/usr/local/bin is already in the PATH)
if [[ -d "/etc/paths.d" && "${homebrew_directory}" == "/opt/homebrew" ]]
then
mkdir -vp /etc/paths.d
echo "/opt/homebrew/bin" >/etc/paths.d/homebrew
chown root:wheel /etc/paths.d/homebrew
fi