allowed relative path in path functions even though directory may not exist.
parent
28bce82117
commit
f88453f6ca
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue