-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·84 lines (71 loc) · 2.12 KB
/
install.sh
File metadata and controls
executable file
·84 lines (71 loc) · 2.12 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
# Install openclaw2go CLI
# Usage: curl -fsSL https://openclaw2go.io/install.sh | sh
set -e
REPO="runpod-workers/openclaw2go-cli"
BINARY="openclaw2go"
INSTALL_DIR="/usr/local/bin"
# Detect OS
OS="$(uname -s)"
case "$OS" in
Darwin) OS="darwin" ;;
Linux) OS="linux" ;;
*) echo "Unsupported OS: $OS. Use install.ps1 for Windows."; exit 1 ;;
esac
# Detect architecture
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) ARCH="amd64" ;;
amd64) ARCH="amd64" ;;
arm64) ARCH="arm64" ;;
aarch64) ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
esac
ASSET="${BINARY}-${OS}-${ARCH}"
# Get latest release tag
echo "Finding latest release..."
TAG=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
if [ -z "$TAG" ]; then
echo "Could not find latest release."
echo "Check https://github.com/${REPO}/releases"
exit 1
fi
URL="https://github.com/${REPO}/releases/download/${TAG}/${ASSET}"
echo "Downloading ${BINARY} ${TAG} for ${OS}/${ARCH}..."
echo " ${URL}"
# Download to temp file
TMP=$(mktemp)
if ! curl -fsSL "$URL" -o "$TMP"; then
echo "Download failed. Check that a release exists for your platform."
echo " OS: ${OS}"
echo " Arch: ${ARCH}"
echo " URL: ${URL}"
rm -f "$TMP"
exit 1
fi
chmod +x "$TMP"
# Install — try /usr/local/bin first, fall back to ~/.local/bin
if [ -w "$INSTALL_DIR" ]; then
mv "$TMP" "${INSTALL_DIR}/${BINARY}"
echo "Installed to ${INSTALL_DIR}/${BINARY}"
elif [ -w "/usr/local/bin" ]; then
mv "$TMP" "/usr/local/bin/${BINARY}"
echo "Installed to /usr/local/bin/${BINARY}"
else
# Fall back to ~/.local/bin
INSTALL_DIR="${HOME}/.local/bin"
mkdir -p "$INSTALL_DIR"
mv "$TMP" "${INSTALL_DIR}/${BINARY}"
echo "Installed to ${INSTALL_DIR}/${BINARY}"
# Check if it's in PATH
case ":$PATH:" in
*":${INSTALL_DIR}:"*) ;;
*)
echo ""
echo "Add this to your shell profile to put it in your PATH:"
echo " export PATH=\"${INSTALL_DIR}:\$PATH\""
;;
esac
fi
echo ""
echo "Run 'openclaw2go version' to verify the installation."