From 1920de4a662d5765c03b328c3d88aa8554daf449 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 11 Feb 2023 10:05:00 +0000 Subject: [PATCH] Check for pyenv before initialising --- home/zprofile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/home/zprofile b/home/zprofile index 285c32d8..4f7124b6 100644 --- a/home/zprofile +++ b/home/zprofile @@ -1,6 +1,8 @@ -export PYENV_ROOT="$HOME/.pyenv" -export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init --path)" +command -v pyenv && { + export PYENV_ROOT="$HOME/.pyenv" + echo $PATH | grep -i pyenv > /dev/null || export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init --path)" +} if [[ -e $HOME/.ssh/id_ed25519 ]] then