Skip to content

Commit

Permalink
use sort --version-sort to compare
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jan 26, 2025
1 parent e9d000a commit 73cd1a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions features/src/mambaforge/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ fi
last_mambaforge_ver="24.7.1"
curr_mambaforge_ver="$(grep -oE '[0-9]+.[0-9]+.[0-9]' <<< "${MAMBAFORGE_VERSION}")";

if [[ "$curr_mambaforge_ver" > "$last_mambaforge_ver" ]]; then
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...";
else
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

# Install Mambaforge
Expand Down

0 comments on commit 73cd1a2

Please sign in to comment.