Skip to content

Commit

Permalink
Fix release URL when VERSION != latest
Browse files Browse the repository at this point in the history
Latest download URL is structured differently than version download URL.
  • Loading branch information
truh authored Oct 8, 2024
1 parent bf019a2 commit 8265a97
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# check if VERSION env variable is set, otherwise use "latest"
$VERSION = if ($null -eq $Env:VERSION) { "latest" } else { $Env:VERSION }

$RELEASE_URL="https://github.com/mamba-org/micromamba-releases/releases/$VERSION/download/micromamba-win-64"
$RELEASE_URL = if ($null -eq $Env:VERSION) {
"https://github.com/mamba-org/micromamba-releases/releases/latest/download/micromamba-win-64"
} else {
"https://github.com/mamba-org/micromamba-releases/releases/download/$Env:VERSION/micromamba-win-64"
}

Write-Output "Downloading micromamba from $RELEASE_URL"
curl.exe -L -o micromamba.exe $RELEASE_URL
Expand Down Expand Up @@ -41,4 +43,4 @@ if ($choice -eq "y" -or $choice -eq "Y" -or $choice -eq "") {
& $MAMBA_INSTALL_PATH shell init -s powershell -p $prefix
} else {
Write-Output "`nYou can always initialize powershell or cmd.exe with micromamba by running `nmicromamba shell init -s powershell -p $Env:UserProfile\micromamba`n"
}
}

0 comments on commit 8265a97

Please sign in to comment.