diff --git a/function/02-path b/function/02-path index 10ffc49..1fa991c 100644 --- a/function/02-path +++ b/function/02-path @@ -14,7 +14,7 @@ path_remove () { path_prepend () { path_remove $1 $2 - if [ -d "$1" ]; then + if ([[ -d "$1" ]] || [[ ! $1 = /* ]]); then local PATHVARIABLE=${2:-PATH} export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}" fi @@ -22,14 +22,14 @@ path_prepend () { path_append () { path_remove $1 $2 - if [ -d "$1" ]; then + if ([[ -d "$1" ]] || [[ ! $1 = /* ]]); then local PATHVARIABLE=${2:-PATH} export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1" fi } path_insert () { - if [ -d "$1" ]; then + if ([[ -d "$1" ]] || [[ ! $1 = /* ]]); then local PATHVAR=${4:-PATH} local temp echo inserting $1 into ${!PATHVAR} $2 $3