1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-02 07:53:39 +08:00
ohmyzsh/plugins/brew/brew.plugin.zsh
Andrew Hodges e263f1f005 Brew Plugin
Merge completion with official brew completion. Add a helper to link official
completion into oh-my-zsh plugin (without overwriting). Add an alias to list
installed brews. Add brews to the path (in a somewhat strange way).
2011-05-28 10:57:48 -04:00

14 lines
707 B
Bash

# Move /usr/local/bin (path where brews are linked) to the front of the path
# This will allow us to override system binaries like ruby with our brews
# TODO: Do this in a more compatible way.
# What if someone doesn't have /usr/bin in their path?
export PATH=`echo $PATH | sed -e 's|/usr/local/bin||' -e 's|::|:|g'` # Remove /usr/local/bin
export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/bin:&|'` # Add it in front of /usr/bin
export PATH=`echo $PATH | sed -e 's|/usr/bin|/usr/local/sbin:&|'` # Add /usr/local/sbin
alias brews='brew list -1'
function brew-link-completion {
ln -s "$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" "$ZSH/plugins/brew/_brew.official"
}