Make more stricter pattern checking to avoid double PATH extending
with same path.
--- a/.env Mon Feb 01 18:06:02 2016 +0200
+++ b/.env Mon Feb 01 18:09:04 2016 +0200
@@ -26,23 +26,23 @@
# Easy cd to often used dirs.
export CDPATH=.:$HOME:$HOME/devel:$HOME/devel/my
-if [[ ! $PATH =~ $HOME/usr/bin ]]; then
+if [[ ! :$PATH: =~ :$HOME/usr/bin: ]]; then
# For local installations and to override /bin, but not /sbin.
export PATH=$HOME/usr/bin:$PATH
fi
-if [[ ! :$PATH =~ :/usr/sbin ]]; then
+if [[ ! :$PATH: =~ :/usr/sbin: ]]; then
export PATH=/usr/sbin:$PATH
fi
-if [[ ! :$PATH =~ :/sbin ]]; then
+if [[ ! :$PATH: =~ :/sbin: ]]; then
export PATH=/sbin:$PATH
fi
-if [[ ! :$PATH =~ :$HOME/.local/bin ]]; then
+if [[ ! :$PATH: =~ :$HOME/.local/bin: ]]; then
export PATH=$PATH:$HOME/.local/bin
fi
[[ -z $LD_LIBRARY_PATH ]] && LD_LIBRARY_PATH=$HOME/usr/lib
-if [[ ! :$LD_LIBRARY_PATH =~ :$HOME/usr/lib ]]; then
+if [[ ! :$LD_LIBRARY_PATH: =~ :$HOME/usr/lib: ]]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":$HOME/usr/lib
fi
@@ -62,7 +62,7 @@
export GRADLE_OPTS='-Dorg.gradle.daemon=true'
-if [[ ! :$PATH =~ :$HOME/.npm-packages/bin ]]; then
+if [[ ! :$PATH: =~ :$HOME/.npm-packages/bin: ]]; then
export PATH=$PATH:$HOME/.npm-packages/bin
fi