Closed astier closed 5 years ago
Thanks for the feedback @astier :smile:. I'm updated the installation instruction to be (hopefully) more clear:
CONDA_ROOT=~/anaconda3 # <- set to your Anaconda/Miniconda installation directory
source $CONDA_ROOT/etc/profile.d/bash_completion.sh
Does this make sense?
I just added to my bashrc
[ -r ~/miniconda3/etc/profile.d/bash_completion.sh ] &&. ~/miniconda3/etc/profile.d/bash_completion.sh
It works. Thanks. Why do we need to set CONDA_ROOT
?
Great that you have got it working! :smile:
I'll think about adding your file existence check, though this is an edge case -- if it gets too convoluted, then its not the right approach.
Setting CONDA_ROOT
was the simplest way I could think of to explain what needed to be done. My other attempts at explaining this where much more convoluted. (If you can think of some alternatives, please, let me know).
Technically, CONDA_ROOT
corresponds to the CONDA_PREFIX
of the CONDA_DEFAULT_ENV
environment, although it is not explicitly defined (I think it should be). You could get there with:
CONDA_ROOT = $(dirname $(dirname $CONDA_EXE)))
but that does not work on all platforms and setups, especially if you install the package into another environment. Ah well. Such is the tyranny of systems programming.
Isn't the file-check required when conda-bash-completion
is not installed?
Isn't the file-check required when
conda-bash-completion
is not installed?
If that's the case, then you would be doing a manual installation, with the bash-completion
library installed and loaded independently. But then you don't need to add anything to your .bashrc
file.
I'll make the two installation methods more explicit.
There might be a case where you:
conda-bash-completion
and bash-completion
as a dependency.bashrc
conda-bash-completion
So protecting against this is reasonable. Thanks for the feedback on this :smile:
I am checking if the file exists because if I make a fresh linux-install I pull my dotfiles with the bashrc which tries to source the conda-completion-file but would fail because I usually don't install conda right away.
Executing the following line as described in the README
fails with the following message
What is the correct path?