blob: 56bdc39a826e027d9c1d832b31c98d8d56bd4204 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# PATH
# add a path to PATH, but only if it's not already there
path_add() { # path_add [-a] PATH...
# -a appends (default is prepend)
APPEND=false
if [ "x$1" = "x-a" ]; then
APPEND=true
shift
fi
for p; do
case ":$PATH:" in
*:"$p":*) ;;
*)
if $APPEND; then
PATH="$PATH:$p"
else
PATH="$p:$PATH"
fi
;;
esac
done
unset APPEND
}
path_add "$HOME/bin" "$HOME/usr/bin"
command -v luarocks >/dev/null 2>&1 && path_add "$HOME/.luarocks/bin"
|