From c0ada61026c1254637b74b69ab36be99bc2aaea0 Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Tue, 17 Jul 2018 14:30:44 +0800 Subject: [PATCH] Add local folder judge Signed-off-by: Ein Verne --- .zshrc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.zshrc b/.zshrc index e26a336..41f4805 100644 --- a/.zshrc +++ b/.zshrc @@ -13,16 +13,20 @@ export PATH="$NODE_HOME/bin/:$PATH" export PATH="$PATH:$HOME/phabricator/arcanist/bin/" -# pyenv -export PATH="$HOME/.pyenv/bin:$PATH" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" - -# rbenv -export GPG_TTY=$(tty) -export PATH="$HOME/.rbenv/bin:$PATH" -eval "$(rbenv init -)" -export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" +if [[ -d ~/.pyenv ]]; then + # pyenv + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" +fi + +if [[ -d ~/.rbenv/ ]]; then + # rbenv + export GPG_TTY=$(tty) + export PATH="$HOME/.rbenv/bin:$PATH" + eval "$(rbenv init -)" + export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" +fi # Path to your oh-my-zsh installation. # export ZSH=$HOME/.oh-my-zsh