mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #20159 from Homebrew/paths_d_homebrew
package/scripts/postinstall: add Homebrew to PATH.
This commit is contained in:
commit
2c89b70f28
@ -93,3 +93,12 @@ mkdir -vp "${user_api_cache_dir}"
|
|||||||
mv -v "${homebrew_directory}/cache_api/"* "${user_api_cache_dir}"
|
mv -v "${homebrew_directory}/cache_api/"* "${user_api_cache_dir}"
|
||||||
chown -R "${homebrew_pkg_user}:staff" "${user_cache_dir}"
|
chown -R "${homebrew_pkg_user}:staff" "${user_cache_dir}"
|
||||||
rm -vrf "${homebrew_directory}/cache_api"
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user