diff --git a/config/bash/bashrc b/config/bash/bashrc index f28b817..6ff0a19 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -2,10 +2,15 @@ [[ $- != *i* ]] && return # == Add personal bin directory to PATH -if [ -d ${HOME}/.local/bin ]; then +if ! [[ "${PATH}" =~ "${HOME}/.local/bin" ]]; then export PATH=${HOME}/.local/bin:${PATH} fi +# == Add custom scripts directory to PATH +if ! [[ "${PATH}" =~ "${HOME}/.local/scripts" ]]; then + export PATH=${HOME}/.local/scripts:${PATH} +fi + export XDG_CONFIG_HOME=${HOME}/.local/config export XDG_DATA_HOME=${HOME}/.local/share export XDG_CACHE_HOME=${HOME}/.local/cache diff --git a/config/bash/bashrc.d/go b/config/bash/bashrc.d/go index d653b53..5d2740f 100644 --- a/config/bash/bashrc.d/go +++ b/config/bash/bashrc.d/go @@ -5,7 +5,10 @@ if [ -f "${HOME}/.local/software/go/bin/go" ]; then export GOPATH=${XDG_DATA_HOME}/go export GOROOT=${HOME}/.local/software/go export GOBIN=${HOME}/.local/goblin - export PATH=${PATH}:${GOBIN} + + if ! [[ "${PATH}" =~ "${GOBIN}" ]]; then + export PATH=${GOBIN}:${PATH} + fi if ! [ -d "${GOPATH}" ]; then mkdir ${GOPATH} diff --git a/config/bash/bashrc.d/local_software b/config/bash/bashrc.d/local_software index 8aea101..f6de046 100644 --- a/config/bash/bashrc.d/local_software +++ b/config/bash/bashrc.d/local_software @@ -2,8 +2,11 @@ if [[ -d "$HOME/.local/software" ]]; then for dir in ${HOME}/.local/software/*; do dir=${dir:A} if [[ -d "$dir/bin" ]]; then - export PATH="$dir/bin:$PATH" + if ! [[ "${PATH}" =~ "$dir/bin" ]]; then + export PATH="$dir/bin:$PATH" + fi fi done fi + unset dir