Test the directory before adding it

This commit is contained in:
Rodolphe Breard 2017-02-12 16:22:28 +01:00
parent 01472b6d05
commit e75abb7795

View file

@ -1,4 +1,6 @@
BIN_PATH="$HOME/bin"
if [ -d "$BIN_PATH" ]; then
found=$(echo $PATH | tr ':' '\n' | grep -w "$BIN_PATH")
[ ! "$found" ] && export PATH="$BIN_PATH:$PATH"
true
fi