Skip to content

Commit

Permalink
always install miniforge
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jan 27, 2025
1 parent 73cd1a2 commit a67a9b7
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions features/src/mambaforge/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env bash
set -e

MAMBAFORGE_VERSION="${VERSION:-latest}";
MINIFORGE_VERSION="${VERSION:-latest}";

# Ensure we're in this feature's directory during build
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
Expand All @@ -12,26 +12,17 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";

check_packages jq git wget bzip2 ca-certificates bash-completion;

echo "Downloading Mambaforge...";
echo "Downloading Miniforge...";

if [[ "$MAMBAFORGE_VERSION" == latest ]]; then
find_version_from_git_tags MAMBAFORGE_VERSION https://github.com/conda-forge/miniforge "tags/" "." "-[0-9]+" "true";
if [[ "$MINIFORGE_VERSION" == latest ]]; then
find_version_from_git_tags MINIFORGE_VERSION https://github.com/conda-forge/miniforge "tags/" "." "-[0-9]+" "true";
fi

last_mambaforge_ver="24.7.1"
curr_mambaforge_ver="$(grep -oE '[0-9]+.[0-9]+.[0-9]' <<< "${MAMBAFORGE_VERSION}")";

if { echo "$curr_mambaforge_ver"; echo "$last_mambaforge_ver"; } | sort --version-sort --check 2>/dev/null; then
wget --no-hsts -q -O /tmp/miniforge.sh \
"https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Mambaforge-${MAMBAFORGE_VERSION}-Linux-$(uname -p).sh";
echo "Installing Mambaforge...";
else
wget --no-hsts -q -O /tmp/miniforge.sh \
"https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Miniforge3-${MAMBAFORGE_VERSION}-Linux-$(uname -p).sh";
echo "Installing Miniforge...";
fi
wget --no-hsts -q -O /tmp/miniforge.sh \
"https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VERSION}/Miniforge3-${MINIFORGE_VERSION}-Linux-$(uname -p).sh";
echo "Installing Miniforge...";

# Install Mambaforge
# Install Miniforge
rm -rf /opt/conda;
/bin/bash /tmp/miniforge.sh -b -p /opt/conda;

Expand Down Expand Up @@ -61,7 +52,7 @@ EOF
# export envvars in /etc/profile.d
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/$(($(ls -1q /etc/profile.d/*.sh | wc -l) + 20))-conda.sh;
ln -s /opt/conda/etc/profile.d/mamba.sh /etc/profile.d/$(($(ls -1q /etc/profile.d/*.sh | wc -l) + 20))-mamba.sh;
add_etc_profile_d_script mambaforge "$(cat .bashrc)";
add_etc_profile_d_script miniforge "$(cat .bashrc)";

# Update the devcontainers/features/common-utils __bash_prompt fn
# to insert ${CONDA_PROMPT_MODIFIER} into the dev container's PS1
Expand Down

0 comments on commit a67a9b7

Please sign in to comment.