From 94192deeb141386039517e8e3e1316837791b38a Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 2 Nov 2024 16:34:44 +0300 Subject: [PATCH] Add `lib/config/conda` Install and configure conda-forge. --- lib/config/conda | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/config/conda diff --git a/lib/config/conda b/lib/config/conda new file mode 100644 index 0000000..a64d3e1 --- /dev/null +++ b/lib/config/conda @@ -0,0 +1,37 @@ +_conda_variant=miniforge +if [ $_conda_variant = miniconda ]; then + CONDA_ROOT="$HOME"/miniconda3 + conda_version=24.9.2-0 +elif [ $_conda_variant = miniforge ]; then + CONDA_ROOT="$HOME"/miniforge3 + conda_version=24.9.0-0 +elif [ $_conda_variant = mambaforge ]; then + CONDA_ROOT="$HOME"/mambaforge + conda_version=24.9.0-0 +fi + +if [ ! -d "$CONDA_ROOT" ]; then + if [ $_conda_variant = miniconda ]; then + wget -N https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && + sh ./Miniconda3-latest-Linux-x86_64.sh -b -p "$CONDA_ROOT" + elif [ $_conda_variant = miniforge ]; then + wget -N https://github.com/conda-forge/miniforge/releases/download/"$conda_version"/Miniforge3-"$conda_version"-Linux-x86_64.sh && + sh ./Miniforge3-"$conda_version"-Linux-x86_64.sh -b -p "$CONDA_ROOT" + elif [ $_conda_variant = mambaforge ]; then + wget -N https://github.com/conda-forge/miniforge/releases/download/"$conda_version"/Mambaforge-"$conda_version"-Linux-x86_64.sh && + sh ./Mambaforge-"$conda_version"-Linux-x86_64.sh -b -p "$CONDA_ROOT" + fi +fi && + +. "$CONDA_ROOT"/etc/profile.d/conda.sh && + +#if [ ! -f "$CONDA_ROOT"/bin/register-python-argcomplete ]; then +#eval "$($CONDA_ROOT/bin/register-python-argcomplete conda)" && +#fi && + +if [ ! -f "$CONDA_ROOT"/etc/profile.d/bash_completion.sh ]; then + conda install --name base --yes conda-bash-completion +fi && +. "$CONDA_ROOT"/etc/profile.d/bash_completion.sh && + +unset _conda_variant CONDA_ROOT conda_version -- 2.39.5