Skip to content

Instantly share code, notes, and snippets.

@steder
Created February 16, 2021 20:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steder/23c061bcc1c983513843a727707f7dd1 to your computer and use it in GitHub Desktop.
Save steder/23c061bcc1c983513843a727707f7dd1 to your computer and use it in GitHub Desktop.
# This is a little slow, so we cache it so we're not running a slow
# find on every terminal startup:
if [[ -e ~/.cache/zsh_exports_gnubin ]]; then
gnubins=(${(ps:\n:)"$(cat ~/.cache/zsh_exports_gnubin)"})
else
gnubins=(${(ps:\n:)"$(find /usr/local/opt -type d -follow -name gnubin -print | tee ~/.cache/zsh_exports_gnubin)"})
fi
for bindir in $gnubins; do
export PATH=$bindir:$PATH;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment