diff --git a/conf/zshrc b/conf/zshrc index 430412c..5d62737 100644 --- a/conf/zshrc +++ b/conf/zshrc @@ -7,17 +7,22 @@ fpath=(~/.zfuncs $fpath) # $MYPREFIX {{{1 -add_myprefix_to() { +add_to() { if [[ `eval echo \$\{\+$1\}` == 1 ]]; then - export $1=$MYPREFIX/$2:`eval echo \$\{$1\}` + export $1=$2:`eval echo \$\{$1\}` else - export $1=$MYPREFIX/$2 + export $1=$2 fi } +add_myprefix_to() { + add_to "$1" "$MYPREFIX/$2" +} + MYPREFIX=~/build/myprefix add_myprefix_to PATH bin 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 lib64 add_myprefix_to MANPATH man