install.sh
AArch64 (ARM64) architecture stringShell command-substitution syntax
SHA-25642f03b834d4ee3c3852c8d1756e1ffc12c37768fe7084751d1bc4a7da53ff4f4
Evidence
1#!/bin/sh
2set -eu
3
4error() {
5 printf 'error: %s\n' "$*" >&2
6 exit 1
7}
8
⋯4 lines
13is_true() {
14 case ${1:-} in
15 1 | true) return 0 ;;
16 *) return 1 ;;
17 esac
18}
19
20info() {
21 if ! is_true "${COMPOSIO_QUIET:-}"; then
22 printf '%s\n' "$*"
23 fi
24}
25
26debug() {
27 if is_true "${COMPOSIO_DEBUG:-}"; then
28 printf '+ %s\n' "$*" >&2
29 fi
30}
31
32# Replays a captured subprocess log on the debug channel. The installer owns
33# its own presentation, so delegated output is suppressed by default and stays
34# available for troubleshooting through COMPOSIO_DEBUG.
35debug_captured_output() {
36 debug_captured_label=$1
37 debug_captured_file=$2
38 if ! is_true "${COMPOSIO_DEBUG:-}" || [ ! -s "$debug_captured_file" ]; then
39 return 0
40 fi
41 debug "$debug_captured_label"
42 sed 's/^/+ /' "$debug_captured_file" >&2 || :
43}
44
45tildify() {
46 case $1 in
47 "$HOME"/*) printf '%s/%s\n' '~' "${1#"$HOME"/}" ;;
48 *) printf ' …
⋯4 lines
52print_usage() {
53 printf '%s\n' \
54 'Usage: install.sh [--agent] [--no-plugins] [version-tag]' \
55 '' \
56 'Options:' \
57 ' --agent Sign up or log i …
63:86… -beta.329.'
64}
65
66validate_identifier() {
67 printf '%s\n' "$2" | grep -Eq '^[A-Za-z0-9._-]+$' ||
68 error "$1 contains invalid characters (got \"$2\")"
69}
70
71url_authority() {
72 printf '%s\n' " …
91:14… idate_url_value in
92 *[![:print:]]* | *[[:space:]]*) return 1 ;;
93 esac
94
95 validate_url_authority=$(url_authority "$validate_url_value")
96 [ -n "$validate_url_authority" ] || return 1
97 case $validate_url_authority in
⋯4 lines
118:34… " || error "Refusing unsafe URL \"$curl_fetch_url\""
119 debug "curl GET $curl_fetch_url"
120 curl --fail --silent --location --proto "$(curl_proto_flags "$curl_fetch_url")" \
121 --proto-redir '=https' "$curl_fetch_url"
122}
⋯5 lines