From 54c549f764f42c156a7c46dd0e20d0b20df04be8 Mon Sep 17 00:00:00 2001 From: juancwu <46619361+juancwu@users.noreply.github.com> Date: Thu, 15 Dec 2022 23:04:57 -0500 Subject: [PATCH] update: generalize the command to actvate conda and load config if file exists --- .config/fish/config.fish | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 34120c9..ef8cbf7 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -2,7 +2,7 @@ set fish_greeting "" # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! -status is-interactive && eval /home/jc/miniconda3/bin/conda "shell.fish" "hook" $argv | source +status is-interactive && eval $HOME/miniconda3/bin/conda "shell.fish" "hook" $argv | source # <<< conda initialize <<< # Go @@ -14,9 +14,15 @@ fish_add_path $GOPATH/bin # load configuration files based on OS switch (uname) case Darwin - source (dirname (status --current-file))/config-darwin.fish + set DARWIN_CONFIG (dirname (status --current-file))/config-darwin.fish + if test -f $DARWIN_CONFIG + source $DARWIN_CONFIG + end case Linux - source (dirname (status --current-file))/config-linux.fish + set LINUX_CONFIG (dirname (status --current-file))/config-linux.fish + if test -f $LINUX_CONFIG + source $LINUX_CONFIG + end end if type -q exa