26 lines
591 B
Plaintext
Executable File
26 lines
591 B
Plaintext
Executable File
#!/usr/bin/env bash
|
|
|
|
# BINs and PATH
|
|
# extend path if directory exists and is not yet contained
|
|
# https://askubuntu.com/questions/432217/prevent-duplicate-entries-in-path
|
|
function extendPath() {
|
|
local new_dir=$1
|
|
if [ -d "$new_dir" ]; then
|
|
[[ ":$PATH:" =~ :$new_dir: ]] || PATH="$new_dir:$PATH"
|
|
fi
|
|
}
|
|
|
|
if [ -x /usr/bin/go ]; then
|
|
extendPath "$(go env GOPATH)/bin"
|
|
export GOPATH=$(go env GOPATH)
|
|
fi
|
|
if [ -d "$HOME/.cargo/bin" ]; then
|
|
extendPath "$HOME/.cargo/bin"
|
|
fi
|
|
|
|
extendPath "$HOME/bin"
|
|
extendPath "/usr/local/bin"
|
|
extendPath "$HOME/.local/bin"
|
|
|
|
export PATH
|