install.sh
AArch64 (ARM64) architecture stringReferences curl flags and HTTP URL
SHA-2561ff405689da3a529f8923a74253c9e537c8bf5716d311a29fbafd36576eb1f3a
Evidence
1#!/bin/sh
2set -eu
3
4# ── ZeroClaw installer ───────────────────────────────────────────
5# Builds and installs ZeroClaw from source.
6# All feature lists and version info read from Cargo.toml — nothing hardcoded.
7# POSIX sh — no bash required. Works on Alpine, Debian, macOS, everywhere.
8
9REPO_URL="https://github.com/zeroclaw-labs/zeroclaw.git"
10
11# ── Output helpers (terminal-aware) ──────────────────────────────
12
13if [ -t 1 ]; then
14 BOLD='\033[1m' GREEN='\033[32m' YELLOW='\033[33m' RED='\033[31m' RESET='\03 …
⋯6 lines
42 [ -f "$toml" ] || die "Cargo.toml not found at $toml"
43
44 VERSION=$(awk '/^\[workspace\.package\]/{p=1;next} /^\[/{p=0} p && /^version *=/{split($0,a,"\"");print a[2]}' "$toml")
45 MSRV=$(awk '/^\[workspace\.package\]/{p=1;next} /^\[/{p=0} p && /^rust-version *=/{split($0,a,"\"");print a[2]}' "$toml")
46 EDITION=$(awk '/^\[workspace\.package\]/{p=1;next} /^\[/{p=0} p && /^edition *=/{split($0,a,"\"");print a[2]}' "$toml")
47
48 DEFAULT_FEATURES=$(feature_members "$toml" default | paste -sd, -)
49
50 ALL_FEATURES=$(awk '/^\[features\]/{p=1;next} /^\[/{p=0} p && /^[a-z][a-z0-9_-]* *=/{sub(/ *=.*/,"");print}' "$toml")
51}
52
53# Print the members of one feature from `[features]`, one per line. Spans
54# multi-line array literals. The single source of truth for reading the
55# feature graph out of Cargo.toml.
56feature_members() {
57 awk -v key="$2" '
58 $0 ~ …
76:16… features() {
77 local toml="$1" queue leaf=" " f members
78 queue=$(printf '%s' "$DEFAULT_FEATURES" | tr ',' ' ')
79 while [ -n "$queue" ]; do
80 f=${queue%% *}; queue=${queue#"$f"}; queue=${queue# }
81 case "$f" in dep:* | */*) continue ;; esac
82 if is_aggregate "$f"; then
83 members=$(feature_members "$toml" "$f" | tr '\n' ' ')
84 queue="$queue $members"
85 else
86 case "$leaf" in *" $f "*) ;; *) leaf="$leaf$f " ;; esac
87 fi
88 done
⋯7 lines
144:59… rometheus'"
145 return 0
146 ;;
147 esac
148 echo "$ALL_FEATURES" | grep -qx "$1" && return 0
149 die "Unknown feature '$1'. Run: $0 --list-features"
150}
151
152selected_feature_enabled() {
153 case ",$USER_FEATU …
199:8… urns 0 if $1 >= $2 (dot-separated version strings)
200 local IFS=.
201 set -- $1 $2
202 local a1="${1:-0}" a2="${2:-0}" a3="${3:-0}"
203 shift 3 2>/dev/null || shift $#
204 local b1="${1:-0}" b2="${2:-0}" b3="${3:-0}"
205
206 [ "$a1" -gt "$b1" ] 2>/dev/null && return 0
207 [ "$a1" -lt "$b1" ] …