commit d4a6fdd2e1b45f1d44c1cb7e6874d7c9688ca90b
parent 967b9198ceb867fd2624aa86c15a3012a6711f7b
Author: Chris Bracken <chris@bracken.jp>
Date: Fri, 21 Jun 2013 15:38:12 -0700
Only prepend/append path if directory exists.
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/.paths b/.paths
@@ -5,12 +5,16 @@ path_remove() {
path_prepend() {
path_remove "$1"
- export PATH="$1:$PATH"
+ if [ -d "$1" ]; then
+ export PATH="$1:$PATH"
+ fi
}
path_append() {
path_remove "$1"
- export PATH="$PATH:$1"
+ if [ -d "$1" ]; then
+ export PATH="$PATH:$1"
+ fi
}
# set PATH so it includes user's private bin if it exists