From ea8277d61c7c02c434e4f481e2c9ff81b9e4e5b2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 10 Mar 2016 00:04:35 +1300 Subject: Check existence before PATH prepend --- sh/profile.d/go.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sh/profile.d/go.sh b/sh/profile.d/go.sh index 51439221..592b651e 100644 --- a/sh/profile.d/go.sh +++ b/sh/profile.d/go.sh @@ -2,6 +2,8 @@ GOPATH=$HOME/.local/gocode export GOPATH -# Prepend GOPATH to PATH for the executables -PATH=$GOPATH/bin:$PATH +# Prepend GOPATH to PATH for the executables if it exists +if [ -d "$GOPATH"/bin ] ; then + PATH=$GOPATH/bin:$PATH +fi -- cgit v1.2.3