11 lines
223 B
Text
11 lines
223 B
Text
|
# -*- mode: sh; -*-
|
||
|
if [[ ! "${(P)${1}}" =~ (^|:)"$2"(:|$) ]]; then
|
||
|
if [ -n "$3" ]; then
|
||
|
# Append
|
||
|
typeset -g $1="${(P)${1}}:$2"
|
||
|
else
|
||
|
# Prepend
|
||
|
typeset -g $1="$2:${(P)${1}}"
|
||
|
fi
|
||
|
fi
|