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:
1 parent
8c515a30a2
commit
787890e5c9
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
|
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
|
Installs a prebuilt binary to `~/.local/bin` — no Rust required. Env vars go on
|
||||||
target dir with `MATCHA_INSTALL_DIR=/usr/local/bin`, or pin a version with
|
the `sh` side of the pipe:
|
||||||
`MATCHA_VERSION=v26.7.0`.
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL …/install.sh | MATCHA_VERSION=v26.7.0 MATCHA_INSTALL_DIR=/usr/local/bin sh
|
||||||
|
```
|
||||||
|
|
||||||
**From source** (requires Rust — compiles and installs):
|
**From source** (requires Rust — compiles and installs):
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ esac
|
|||||||
version="${MATCHA_VERSION:-latest}"
|
version="${MATCHA_VERSION:-latest}"
|
||||||
if [ "$version" = "latest" ]; then
|
if [ "$version" = "latest" ]; then
|
||||||
tag=$(fetch "$REPO_BASE/api/v1/repos/Green-Tea/matcha/releases/latest" \
|
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"
|
[ -n "$tag" ] || err "could not resolve latest release tag"
|
||||||
else
|
else
|
||||||
tag="$version"
|
tag="$version"
|
||||||
|
|||||||
Reference in new issue
Block a user