-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·36 lines (28 loc) · 1 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·36 lines (28 loc) · 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
#!/bin/sh
set -e
REPO="ArmanJR/PolyClaude"
INSTALL_DIR="/usr/local/bin"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$ARCH" in
x86_64|amd64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac
VERSION=$(curl -sSf "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name"' | cut -d '"' -f4)
if [ -z "$VERSION" ]; then
echo "Failed to fetch latest version" >&2
exit 1
fi
URL="https://github.com/${REPO}/releases/download/${VERSION}/PolyClaude_${VERSION#v}_${OS}_${ARCH}.tar.gz"
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
echo "Downloading polyclaude ${VERSION} (${OS}/${ARCH})..."
curl -sSfL "$URL" -o "${TMPDIR}/polyclaude.tar.gz"
tar xzf "${TMPDIR}/polyclaude.tar.gz" -C "$TMPDIR"
if [ -w "$INSTALL_DIR" ]; then
mv "${TMPDIR}/polyclaude" "${INSTALL_DIR}/polyclaude"
else
sudo mv "${TMPDIR}/polyclaude" "${INSTALL_DIR}/polyclaude"
fi
echo "Installed polyclaude ${VERSION} to ${INSTALL_DIR}/polyclaude"