Skip to content

Commit 2b80c04

Browse files
dhaneshclaude
andcommitted
feat(install): auto-detect latest version from github api
- Fetch latest release tag from GitHub API dynamically - Fall back to hardcoded version if API unavailable (offline/rate-limited) - No more manual version bumps needed in install script Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e6cb4f4 commit 2b80c04

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

install/install.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,23 @@ NC='\033[0m' # No Color
1818
BOLD='\033[1m'
1919

2020
# Manifold info
21-
VERSION="2.2.1"
22-
CLI_VERSION="2.2.1"
2321
REPO="https://raw.githubusercontent.com/dhanesh/manifold/main"
2422
RELEASES="https://github.com/dhanesh/manifold/releases/download"
23+
FALLBACK_VERSION="2.2.1"
24+
25+
# Fetch latest version from GitHub API (falls back to hardcoded if API unavailable)
26+
get_latest_version() {
27+
local version
28+
version=$(curl -fsSL "https://api.github.com/repos/dhanesh/manifold/releases/latest" 2>/dev/null | grep '"tag_name"' | sed -E 's/.*"v?([^"]+)".*/\1/')
29+
if [ -z "$version" ]; then
30+
echo "$FALLBACK_VERSION"
31+
else
32+
echo "$version"
33+
fi
34+
}
35+
36+
VERSION=$(get_latest_version)
37+
CLI_VERSION="$VERSION"
2538

2639
print_banner() {
2740
echo ""

0 commit comments

Comments
 (0)