-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·68 lines (56 loc) · 2.1 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·68 lines (56 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env sh
# Install commis — hire an agent, not a SaaS.
# curl -fsSL https://raw.githubusercontent.com/javimosch/commis/main/install.sh | sh
# Env: VERSION (default latest) · PREFIX (default ~/.local/bin, or /usr/local/bin as root)
set -eu
REPO="javimosch/commis"
VERSION="${VERSION:-latest}"
if [ "$(id -u)" = "0" ]; then
PREFIX="${PREFIX:-/usr/local/bin}"
else
PREFIX="${PREFIX:-$HOME/.local/bin}"
fi
os=$(uname -s)
arch=$(uname -m)
[ "$os" = "Linux" ] || { echo "commis ships a linux-x86_64 binary; on $os build from source (./build.sh)" >&2; exit 1; }
case "$arch" in
x86_64|amd64) : ;;
*) echo "commis ships a linux-x86_64 binary; on $arch build from source (./build.sh)" >&2; exit 1 ;;
esac
if [ "$VERSION" = "latest" ]; then
URL="https://github.com/$REPO/releases/latest/download/commis"
else
URL="https://github.com/$REPO/releases/download/$VERSION/commis"
fi
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
echo "fetching $URL"
if ! curl -fsSL "$URL" -o "$tmp/commis"; then
echo "download failed — check that $VERSION has a release asset named 'commis'" >&2
exit 1
fi
chmod +x "$tmp/commis"
# Verify the thing runs before it replaces anything on PATH.
if ! "$tmp/commis" version >/dev/null 2>&1; then
echo "the downloaded binary does not run; leaving your install alone" >&2
exit 1
fi
mkdir -p "$PREFIX"
mv "$tmp/commis" "$PREFIX/commis"
echo "installed $PREFIX/commis ($("$PREFIX/commis" version))"
case ":$PATH:" in
*":$PREFIX:"*) ;;
*) echo "note: $PREFIX is not on your PATH" ;;
esac
cat <<'EOF'
next:
commis guide # the mental model, as JSON — read this first
commis catalog # who you can hire
commis hire menage # needs nothing: no secrets, no wallet, no hart
commis brief menage "audit disk"
commis plan menage # exactly what would run, for free
commis drives roam (https://github.com/javimosch/roam) as its runtime — it has
no install.sh, so grab the static binary:
curl -fsSL https://github.com/javimosch/roam/releases/latest/download/roam-x86_64-linux -o roam
chmod +x roam && sudo mv roam /usr/local/bin/roam
EOF