Skip to content

Instantly share code, notes, and snippets.

@phdd
Created March 24, 2022 08:36
Show Gist options
  • Save phdd/3c205cb2fb8fb4397ef44bece82c2968 to your computer and use it in GitHub Desktop.
Save phdd/3c205cb2fb8fb4397ef44bece82c2968 to your computer and use it in GitHub Desktop.
ZSH Plugin for Lazy Loading Miniconda (Arch Linux) adopted from https://reddit.com/qmd25q
load_miniconda() {
unalias conda
__conda_setup="$('/opt/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/miniconda3/etc/profile.d/conda.sh" ]; then
. "/opt/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
unfunction load_miniconda
}
alias conda="load_miniconda && conda"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment