e25e44a98d
changed setup.sh to load.sh startup only loads system repos by default and allows passing directory argument
24 lines
636 B
Text
24 lines
636 B
Text
path_remove () {
|
|
local IFS=':'
|
|
local NEWPATH
|
|
local DIR
|
|
local PATHVARIABLE=${2:-PATH}
|
|
for DIR in ${!PATHVARIABLE} ; do
|
|
if [ "$DIR" != "$1" ] ; then
|
|
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
|
|
fi
|
|
done
|
|
export $PATHVARIABLE="$NEWPATH"
|
|
}
|
|
|
|
path_prepend () {
|
|
path_remove $1 $2
|
|
local PATHVARIABLE=${2:-PATH}
|
|
export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
|
|
}
|
|
|
|
path_append () {
|
|
path_remove $1 $2
|
|
local PATHVARIABLE=${2:-PATH}
|
|
export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
|
|
}
|