dotar/zsh/0_path.zsh

18 lines
540 B
Bash
Raw Normal View History

2012-04-03 01:46:02 +08:00
# path, the 0 in the filename causes this to load first
2019-04-10 18:34:12 +08:00
pathAppend() {
# Only adds to the path if it's not already there
if ! echo $PATH | egrep -q "(^|:)$1($|:)" ; then
PATH=$PATH:$1
fi
}
2019-04-10 18:40:13 +08:00
# Remove duplicate entries from PATH:
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
2019-04-10 18:34:12 +08:00
pathAppend "$HOME/.yadr/bin/yadr"
2021-09-16 05:13:42 +08:00
pathAppend "$HOME/.local/bin:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin"
2021-07-29 00:09:53 +08:00
if [[ `uname` == "Darwin" ]]; then
pathAppend "/usr/local/opt/libpq/bin"
fi