From ec871aedabbadabc57faf9f4c0b1b7d0fbe410e7 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Thu, 19 Oct 2017 22:54:42 -0700 Subject: [PATCH] Only add env vars for existing dirs --- profile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/profile b/profile index f14a91e..6045384 100644 --- a/profile +++ b/profile @@ -1,4 +1,6 @@ -export DEVPATH=$HOME/dev +if [[ -d "$HOME/dev" ]]; then + export DEVPATH="$HOME/dev" +fi if [[ -n "$(echo $SHELL | grep zsh)" ]]; then export ZSH=$HOME/.oh-my-zsh @@ -24,8 +26,8 @@ if [[ -d "$DEVPATH/android/android-ndk" ]]; then fi which go &> /dev/null -if (( !$? )); then - export GOPATH=$DEVPATH/go +if (( !$? )) && [[ -d "$DEVPATH/go" ]]; then + export GOPATH="$DEVPATH/go" fi function passgen () {