2022-08-29 17:54:03 -04:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
# locally install mamba for this user
|
2022-09-08 14:47:57 -04:00
|
|
|
#
|
|
|
|
# USAGE: bootstrap_mamba [VERSION]
|
|
|
|
#
|
|
|
|
# where VERSION is something like 'X.Y.Z-A' corresponding to a tagged release
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Installing latest version of mambaforge"
|
|
|
|
subdir=latest/download
|
|
|
|
else
|
|
|
|
echo "Installing version $1 of mambaforge"
|
|
|
|
subdir="download/$1"
|
|
|
|
fi
|
2022-08-29 17:54:03 -04:00
|
|
|
|
|
|
|
bin_path=~/.local/bin/mamba_installer.sh
|
|
|
|
mamba_root=$XDG_DATA_HOME/mambaforge
|
|
|
|
|
|
|
|
# this needs to be present or else the installer will fail
|
|
|
|
mkdir -p $XDG_DATA_HOME/conda/{pkgs,envs}
|
|
|
|
|
|
|
|
# TODO configure version
|
2022-09-08 14:47:57 -04:00
|
|
|
curl -L -o "$bin_path" "https://github.com/conda-forge/miniforge/releases/$subdir/Mambaforge-$(uname)-$(uname -m).sh"
|
2022-08-29 17:54:03 -04:00
|
|
|
|
|
|
|
bash "$bin_path" -p "$mamba_root" -b -f
|
|
|
|
|
2022-09-08 14:47:57 -04:00
|
|
|
#rm -f "$bin_path"
|