zshrc: add ~/.gem/.../bin to PATH

This commit is contained in:
Gabriel Ebner 2010-03-18 11:10:15 +01:00
parent dee6164c8c
commit 189246e10a

@ -7,17 +7,22 @@ fpath=(~/.zfuncs $fpath)
# $MYPREFIX {{{1 # $MYPREFIX {{{1
add_myprefix_to() { add_to() {
if [[ `eval echo \$\{\+$1\}` == 1 ]]; then if [[ `eval echo \$\{\+$1\}` == 1 ]]; then
export $1=$MYPREFIX/$2:`eval echo \$\{$1\}` export $1=$2:`eval echo \$\{$1\}`
else else
export $1=$MYPREFIX/$2 export $1=$2
fi fi
} }
add_myprefix_to() {
add_to "$1" "$MYPREFIX/$2"
}
MYPREFIX=~/build/myprefix MYPREFIX=~/build/myprefix
add_myprefix_to PATH bin add_myprefix_to PATH bin
add_myprefix_to PATH sbin add_myprefix_to PATH sbin
add_to PATH ~/.gem/ruby/1.8/bin
add_myprefix_to LD_LIBRARY_PATH lib add_myprefix_to LD_LIBRARY_PATH lib
add_myprefix_to LD_LIBRARY_PATH lib64 add_myprefix_to LD_LIBRARY_PATH lib64
add_myprefix_to MANPATH man add_myprefix_to MANPATH man