forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
path.zsh
29 lines (22 loc) · 834 Bytes
/
path.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Prepend directories to $PATH and prevent adding the same directory multiple times upon shell reload.
_add_to_path() {
NEW_PATH="${1:?Path is required}"
if [[ -d "${NEW_PATH}" ]] && [[ ":${PATH}:" != *":${NEW_PATH}:"* ]]; then
export PATH="$NEW_PATH:$PATH"
fi
}
# Load personal binaries
_add_to_path "${HOME}/bin"
# Add Homebrew coreutils to path for GNU utilities
_add_to_path "/usr/local/opt/coreutils/libexec/gnubin"
# Load global Node installed binaries
_add_to_path "${HOME}/.node/bin"
# Use project specific binaries before global ones
_add_to_path "vendor/bin"
_add_to_path "node_modules/.bin"
# Local bin directories before anything else
_add_to_path "/usr/local/bin"
# Add Java to path
_add_to_path "/opt/homebrew/opt/openjdk/bin"
# Add linux's man to the manpath
export MANPATH="/usr/local/man:${MANPATH}"