From 7080b207a7155ef393739f79394ba3a03b2a7bd9 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 12 Jul 2026 18:13:54 -0500 Subject: [PATCH] fix: installer resolves latest via host-root API (was 404 on repo-path); add matcha --version Signed-off-by: Diego Resendez --- install.sh | 5 ++++- src/cli.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 230b5d9..f719f49 100755 --- a/install.sh +++ b/install.sh @@ -6,6 +6,9 @@ set -eu REPO_BASE="${MATCHA_REPO_BASE:-https://git.svc.zoit.services/Green-Tea/matcha}" +# The API lives at the host root (/api/v1/...), NOT under the repo path. Keep it +# separate from REPO_BASE (which is used for release DOWNLOAD urls under the repo). +API_BASE="${MATCHA_API_BASE:-https://git.svc.zoit.services/api/v1/repos/Green-Tea/matcha}" INSTALL_DIR="${MATCHA_INSTALL_DIR:-$HOME/.local/bin}" err() { echo "matcha-install: $*" >&2; exit 1; } @@ -47,7 +50,7 @@ esac version="${MATCHA_VERSION:-latest}" if [ "$version" = "latest" ]; then - tag=$(fetch "$REPO_BASE/api/v1/repos/Green-Tea/matcha/releases/latest" \ + tag=$(fetch "$API_BASE/releases/latest" \ | grep -o '"tag_name":[[:space:]]*"[^"]*"' | head -1 | cut -d'"' -f4) [ -n "$tag" ] || err "could not resolve latest release tag" else diff --git a/src/cli.rs b/src/cli.rs index 553806f..acddbf9 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,7 @@ use clap::{Parser, Subcommand}; #[derive(Parser)] -#[command(name = "matcha", about = "green-tea CLI")] +#[command(name = "matcha", version, about = "green-tea CLI")] pub struct Cli { #[command(subcommand)] pub command: Command,