From ee51b1d0b86ae89b7691d02b8c7e13843265d0e5 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sun, 5 Mar 2023 09:30:21 +0100 Subject: [PATCH] conditional anaconda setup --- zsh/.config/zsh/.zshrc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 0f3a6aa..2c55b45 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -98,20 +98,22 @@ export ANDROID_HOME="/home/leon/Android/Sdk" export ANDROID_NDK="/home/leon/Android/Sdk/ndk/21.4.7075529" export JAVA_HOME="/usr/lib/jvm/java-1.19.0-openjdk-amd64/" -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/home/leon/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" -if [ $? -eq 0 ]; then - eval "$__conda_setup" -else - if [ -f "/home/leon/anaconda3/etc/profile.d/conda.sh" ]; then - . "/home/leon/anaconda3/etc/profile.d/conda.sh" +if [ -d "$HOME/anaconda3" ]; then + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + __conda_setup="$('/home/leon/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" + if [ $? -eq 0 ]; then + eval "$__conda_setup" else - export PATH="/home/leon/anaconda3/bin:$PATH" + if [ -f "/home/leon/anaconda3/etc/profile.d/conda.sh" ]; then + . "/home/leon/anaconda3/etc/profile.d/conda.sh" + else + export PATH="/home/leon/anaconda3/bin:$PATH" + fi fi + unset __conda_setup + # <<< conda initialize <<< fi -unset __conda_setup -# <<< conda initialize <<< export PATH="/home/leon/.volta/bin:$PATH"