fix(install): tolerate whitespace in latest-tag JSON; doc env vars on pipe
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
2 files changed
+7
-4
No files matched your search
@@ -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):
|
||||
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user