Skip to content

Commit

Permalink
homebrew: Load standard Homebrew environment variables into shell ses…
Browse files Browse the repository at this point in the history
…sion.

However, guard for legacy Homebrew as `brew shellenv` is relatively new.
  • Loading branch information
indrajitr authored and belak committed Sep 15, 2018
1 parent dd7a26e commit 2bbf5d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/homebrew/README.md
Original file line number Diff line number Diff line change
@@ -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
-------
Expand Down
10 changes: 10 additions & 0 deletions modules/homebrew/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down

0 comments on commit 2bbf5d0

Please sign in to comment.