Only add directories to PATH that are already in PATH

This commit is contained in:
Buddy Sandidge 2016-12-26 22:39:53 -08:00
parent e39241c981
commit 26abac727b

View File

@ -36,6 +36,9 @@ fi
function _add-path { function _add-path {
dir="$1" dir="$1"
if [[ $PATH =~ .*$dir.* ]]; then
return
fi
if [[ -d $dir ]]; then if [[ -d $dir ]]; then
PATH=$dir:$PATH PATH=$dir:$PATH
fi fi