Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b0b9b208a | ||
|
|
a339ac853b |
+16
-4
@@ -23,12 +23,24 @@ $Arch = switch ($env:PROCESSOR_ARCHITECTURE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($Version -eq "latest") {
|
if ($Version -eq "latest") {
|
||||||
Write-Host "Resolving the latest SciMesh release..."
|
Write-Host "Resolving the newest SciMesh release (including pre-releases)..."
|
||||||
$Url = "https://github.com/$Repo/releases/latest/download/coordinator-windows-$Arch.exe"
|
# /releases/latest only sees stable releases; the API list is newest-first
|
||||||
} else {
|
# across all channels.
|
||||||
$Url = "https://github.com/$Repo/releases/download/$Version/coordinator-windows-$Arch.exe"
|
try {
|
||||||
|
$Releases = Invoke-RestMethod -Uri "https://api.github.com/repos/$Repo/releases?per_page=1"
|
||||||
|
if ($Releases -and $Releases[0].tag_name) {
|
||||||
|
$Version = $Releases[0].tag_name
|
||||||
|
Write-Host " -> $Version"
|
||||||
|
} else {
|
||||||
|
Write-Host " -> falling back to the stable latest release"
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Host " -> falling back to the stable latest release"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$Url = "https://github.com/$Repo/releases/download/$Version/coordinator-windows-$Arch.exe"
|
||||||
|
|
||||||
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
|
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
|
||||||
$Target = Join-Path $InstallDir "coordinator.exe"
|
$Target = Join-Path $InstallDir "coordinator.exe"
|
||||||
|
|
||||||
|
|||||||
+20
-4
@@ -27,15 +27,23 @@ case "$(uname -m)" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$VERSION" = "latest" ]; then
|
if [ "$VERSION" = "latest" ]; then
|
||||||
echo "Resolving the latest SciMesh release..."
|
echo "Resolving the newest SciMesh release (including pre-releases)..."
|
||||||
URL="https://github.com/${REPO}/releases/latest/download/coordinator-${OS}-${ARCH}"
|
# GitHub's /releases/latest only sees stable releases; the API list is
|
||||||
else
|
# newest-first across all channels. Without jq, pull the first tag_name.
|
||||||
URL="https://github.com/${REPO}/releases/download/${VERSION}/coordinator-${OS}-${ARCH}"
|
RESOLVED=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases?per_page=1" \
|
||||||
|
| sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -1)
|
||||||
|
if [ -n "$RESOLVED" ]; then
|
||||||
|
VERSION="$RESOLVED"
|
||||||
|
echo " -> $VERSION"
|
||||||
|
else
|
||||||
|
echo " -> falling back to the stable latest release"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$INSTALL_DIR"
|
mkdir -p "$INSTALL_DIR"
|
||||||
TARGET="$INSTALL_DIR/coordinator"
|
TARGET="$INSTALL_DIR/coordinator"
|
||||||
|
|
||||||
|
URL="https://github.com/${REPO}/releases/download/${VERSION}/coordinator-${OS}-${ARCH}"
|
||||||
echo "Downloading $URL"
|
echo "Downloading $URL"
|
||||||
curl -fsSL -o "$TARGET.tmp" "$URL"
|
curl -fsSL -o "$TARGET.tmp" "$URL"
|
||||||
chmod +x "$TARGET.tmp"
|
chmod +x "$TARGET.tmp"
|
||||||
@@ -43,7 +51,15 @@ mv "$TARGET.tmp" "$TARGET"
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "SciMesh installed: $TARGET"
|
echo "SciMesh installed: $TARGET"
|
||||||
|
INSTALLED_VERSION=$("$TARGET" --version 2>/dev/null | awk '{print $2}')
|
||||||
"$TARGET" --version
|
"$TARGET" --version
|
||||||
|
if [ -n "$INSTALLED_VERSION" ] && [ "$INSTALLED_VERSION" != "${VERSION#v}" ]; then
|
||||||
|
echo
|
||||||
|
echo "WARNING: expected version $VERSION but got $INSTALLED_VERSION."
|
||||||
|
echo "This is usually a stale download cache. Re-run the installer in a few"
|
||||||
|
echo "minutes, or pin the version explicitly:"
|
||||||
|
echo " SCIMESH_VERSION=${VERSION} bash <(curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh)"
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
echo "Start the platform (one command, everything embedded):"
|
echo "Start the platform (one command, everything embedded):"
|
||||||
echo " $TARGET serve --open"
|
echo " $TARGET serve --open"
|
||||||
|
|||||||
Reference in New Issue
Block a user