docs/ci: zag is public, drop token handling from the formula, installer and README
CI / test (push) Successful in 3m23s
CI / test (push) Successful in 3m23s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
24c7a2804d
commit
4db6b7b1b3
3 files changed
+8
-25
No files matched your search
+2
-5
@@ -5,7 +5,6 @@
|
||||
#
|
||||
# Environment:
|
||||
# ZAG_VERSION release tag to install (default: latest)
|
||||
# ZAG_TOKEN Gitea access token (the repository is private)
|
||||
# ZAG_PREFIX install directory (default: /usr/local/bin as root, ~/.local/bin otherwise)
|
||||
# ZAG_NO_SERVICE=1 skip `zag service install`
|
||||
set -eu
|
||||
@@ -27,17 +26,15 @@ case "$(uname -m)" in
|
||||
*) die "unsupported architecture: $(uname -m)" ;;
|
||||
esac
|
||||
|
||||
auth=""
|
||||
[ -n "${ZAG_TOKEN:-}" ] && auth="Authorization: token $ZAG_TOKEN"
|
||||
fetch() { # fetch <url> <output>
|
||||
if [ -n "$auth" ]; then curl -fsSL -H "$auth" -o "$2" "$1"; else curl -fsSL -o "$2" "$1"; fi
|
||||
curl -fsSL -o "$2" "$1"
|
||||
}
|
||||
|
||||
version="${ZAG_VERSION:-}"
|
||||
if [ -z "$version" ]; then
|
||||
info "Looking up the latest release"
|
||||
tmp_json=$(mktemp)
|
||||
fetch "$BASE/api/v1/repos/$REPO/releases/latest" "$tmp_json" || die "could not query releases (is ZAG_TOKEN set?)"
|
||||
fetch "$BASE/api/v1/repos/$REPO/releases/latest" "$tmp_json" || die "could not query releases"
|
||||
version=$(sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$tmp_json" | head -1)
|
||||
rm -f "$tmp_json"
|
||||
[ -n "$version" ] || die "could not determine the latest version"
|
||||
|
||||
Reference in new issue
Block a user