blob: 18720e0187f4f322fbdf3f3adc1ce1f340338c87 (
plain)
1
2
3
4
5
6
7
8
9
10
|
# -*- 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
|