From 995c3cd45ef3dd281082597c129ca6d7b563c00e Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 12 Jul 2026 18:00:29 -0500 Subject: [PATCH] fix(install): tolerate whitespace in latest-tag JSON; doc env vars on pipe Signed-off-by: Diego Resendez --- README.md | 9 ++++++--- install.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b1312c0..d671fb8 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,12 @@ The [green-tea](https://git.svc.zoit.services/Green-Tea/core) CLI — scaffold, curl -fsSL https://git.svc.zoit.services/Green-Tea/matcha/raw/branch/main/install.sh | sh ``` -Installs a prebuilt binary to `~/.local/bin` — no Rust required. Override the -target dir with `MATCHA_INSTALL_DIR=/usr/local/bin`, or pin a version with -`MATCHA_VERSION=v26.7.0`. +Installs a prebuilt binary to `~/.local/bin` — no Rust required. Env vars go on +the `sh` side of the pipe: + +```bash +curl -fsSL …/install.sh | MATCHA_VERSION=v26.7.0 MATCHA_INSTALL_DIR=/usr/local/bin sh +``` **From source** (requires Rust — compiles and installs): diff --git a/install.sh b/install.sh index eeab11a..230b5d9 100755 --- a/install.sh +++ b/install.sh @@ -48,7 +48,7 @@ esac version="${MATCHA_VERSION:-latest}" if [ "$version" = "latest" ]; then tag=$(fetch "$REPO_BASE/api/v1/repos/Green-Tea/matcha/releases/latest" \ - | grep -o '"tag_name":"[^"]*"' | head -1 | cut -d'"' -f4) + | grep -o '"tag_name":[[:space:]]*"[^"]*"' | head -1 | cut -d'"' -f4) [ -n "$tag" ] || err "could not resolve latest release tag" else tag="$version"