homebrew: Load standard Homebrew environment variables into shell session.

However, guard for legacy Homebrew as `brew shellenv` is relatively new.
This commit is contained in:
Indrajit Raychaudhuri 2018-09-14 23:40:08 -05:00 committed by Kaleb Elwert
parent dd7a26e219
commit 2bbf5d0687
2 changed files with 20 additions and 1 deletions

View file

@ -1,7 +1,16 @@
Homebrew
========
Defines Homebrew aliases.
Defines Homebrew specific shell environment variables and aliases.
Environment Variables
---------------------
Execute the following to list the environment variables loaded in the shell:
```sh
brew shellenv
```
Aliases
-------

View file

@ -10,6 +10,16 @@ if [[ "$OSTYPE" != (darwin|linux)* ]]; then
return 1
fi
#
# Environmental Variables
#
# Load standard Homebrew shellenv into the shell session.
# `brew shellenv` is relatively new, guard for legacy Homebrew.
if (( $+commands[brew] )); then
eval "$(brew shellenv 2> /dev/null)"
fi
#
# Aliases
#