mirror of
https://codeberg.org/hyperreal/dotfiles
synced 2024-11-01 16:53:07 +01:00
29 lines
796 B
Plaintext
29 lines
796 B
Plaintext
|
# PATH variable declaration as array
|
||
|
# -U means unique, which tells the shell not to add anything to the array if it's
|
||
|
# already there.
|
||
|
typeset -U PATH path
|
||
|
|
||
|
# Add /usr/local dirs to PATH
|
||
|
path=("/usr/local/bin" "/usr/local/sbin")
|
||
|
path+=("/bin" "/sbin" "/usr/bin" "/usr/sbin")
|
||
|
|
||
|
# Set Go path if it exists
|
||
|
[ -d "${HOME}/go" ] && GOPATH="${HOME}/go" && path+=("${GOPATH}/bin")
|
||
|
|
||
|
# Set Cargo path for Rust binaries
|
||
|
[ -d "${HOME}/.cargo/bin" ] && path+=("${HOME}/.cargo/bin")
|
||
|
|
||
|
# Add ~/bin to PATH
|
||
|
[ -d "${HOME}/bin" ] && path+=("${HOME}/bin")
|
||
|
|
||
|
# Add ~/.local/bin to PATH
|
||
|
[ -d "${HOME}/.local/bin" ] && path+=("${HOME}/.local/bin")
|
||
|
|
||
|
# Add /snap/bin to PATH
|
||
|
[ -d "/snap/bin" ] && path+=("/snap/bin")
|
||
|
|
||
|
export PATH
|
||
|
|
||
|
# Automatically remove duplicates from these arrays
|
||
|
typeset -gU path cdpath manpath fpath
|