Created
March 22, 2024 19:59
-
-
Save Farid-NL/602f74034747b388cea5a9e177131234 to your computer and use it in GitHub Desktop.
Lazy loading for (mini)conda in zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export CONDA_DIR="$HOME/.miniconda" | |
| source ~/your/path/conda-lazy.zsh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conda() { | |
| unfunction conda | |
| __conda_setup="$("$CONDA_DIR/bin/conda" 'shell.zsh' 'hook' 2> /dev/null)" | |
| if [ $? -eq 0 ]; then | |
| eval "$__conda_setup" | |
| else | |
| if [ -f "$CONDA_DIR/etc/profile.d/conda.sh" ]; then | |
| . "$CONDA_DIR/etc/profile.d/conda.sh" | |
| else | |
| export PATH="$CONDA_DIR/bin:$PATH" | |
| fi | |
| fi | |
| unset __conda_setup | |
| conda "$@" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment