From 3e2adeab65fe83e190be693c04be11a1f3e379b4 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Mon, 17 Apr 2023 13:13:50 +0200 Subject: [PATCH] chore: rewrite conda setup to run on Intel and Silicon Macs --- fish/config.fish | 9 ++++----- zsh/zshrc | 16 +++------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/fish/config.fish b/fish/config.fish index 2ea8346..093bf11 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -51,12 +51,11 @@ set --export FZF_TMUX_OPTS -p set --export FZF_ALT_C_COMMAND "fd --type d $FD_OPTIONS --color=never --hidden" set --export FZF_ALT_C_OPTS "--preview 'tree -C {} | head -50'" -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -if test -f /opt/homebrew/Caskroom/miniconda/base/bin/conda - eval /opt/homebrew/Caskroom/miniconda/base/bin/conda "shell.fish" hook $argv | source +# Conda +set conda_path (brew --prefix)/Caskroom/miniconda/base/bin/conda +if test -f $conda_path + eval $conda_path "shell.fish" hook $argv | source end -# <<< conda initialize <<< # Zoxide zoxide init fish | source diff --git a/zsh/zshrc b/zsh/zshrc index 0b24db5..cae6807 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -60,20 +60,10 @@ eval "$(zoxide init zsh)" export PATH="/Library/TeX/texbin:$PATH" # Conda -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/usr/local/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" -if [ $? -eq 0 ]; then - eval "$__conda_setup" -else - if [ -f "/usr/local/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then - . "/usr/local/Caskroom/miniconda/base/etc/profile.d/conda.sh" - else - export PATH="/usr/local/Caskroom/miniconda/base/bin:$PATH" - fi +conda_path=$(brew --prefix)/Caskroom/miniconda/base/bin/conda +if [ -f "$conda_path" ]; then + eval "$("$conda_path" shell.zsh hook $argv)" | source fi -unset __conda_setup -# <<< conda initialize <<< # Man export MANPATH="/usr/local/man:$MANPATH"