-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·46 lines (36 loc) · 1.09 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·46 lines (36 loc) · 1.09 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
#!/bin/bash
set -euo pipefail
REPO="Rag0n/agentbox"
INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}"
# Check platform
ARCH=$(uname -m)
OS=$(uname -s)
if [ "$OS" != "Darwin" ]; then
echo "Error: agentbox requires macOS. Detected: $OS" >&2
exit 1
fi
if [ "$ARCH" != "arm64" ]; then
echo "Error: agentbox requires Apple Silicon (arm64). Detected: $ARCH" >&2
exit 1
fi
# Create install directory
mkdir -p "$INSTALL_DIR"
# Download and extract
ASSET="agentbox-darwin-arm64.tar.gz"
URL="https://github.com/$REPO/releases/latest/download/$ASSET"
echo "Downloading agentbox..."
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
curl -fsSL "$URL" -o "$TMPDIR/$ASSET"
tar xzf "$TMPDIR/$ASSET" -C "$TMPDIR"
mv "$TMPDIR/agentbox" "$INSTALL_DIR/agentbox"
chmod +x "$INSTALL_DIR/agentbox"
echo "Installed agentbox to $INSTALL_DIR/agentbox"
"$INSTALL_DIR/agentbox" --version
# Check PATH
if ! echo "$PATH" | tr ':' '\n' | grep -qx "$INSTALL_DIR"; then
echo ""
echo "Note: $INSTALL_DIR is not in your PATH."
echo "Add it with:"
echo " echo 'export PATH=\"$INSTALL_DIR:\$PATH\"' >> ~/.zshrc"
fi