Mercurial > repos > other > linux
changeset 127:724d0e149569
Add a function for base Conda activation
This lets us CHOOSE to use Conda rather than having it always
enabled (which is their default setup) without having to remember
to "source ~/.local/bin/conda_activate"
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 09 Sep 2019 11:19:12 +0100 |
parents | f762f1a9c80f |
children | 9d522c13ec68 |
files | bashrc |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bashrc Thu Jun 06 20:05:16 2019 +0100 +++ b/bashrc Mon Sep 09 11:19:12 2019 +0100 @@ -74,4 +74,18 @@ # Set a hidden R package directory export R_LIBS_USER=~/.R/ # And stop it asking us to save the workspace -alias R='R --no-save' \ No newline at end of file +alias R='R --no-save' + +conda_activate() { + __conda_setup="$(~/.anaconda3/bin/conda 'shell.bash' 'hook' 2> /dev/null)" + if [ $? -eq 0 ]; then + eval "$__conda_setup" + else + if [ -f ~"/.anaconda3/etc/profile.d/conda.sh" ]; then + . ~"/.anaconda3/etc/profile.d/conda.sh" + else + export PATH=~"/.anaconda3/bin:$PATH" + fi + fi + unset __conda_setup +} \ No newline at end of file