-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
102 lines (85 loc) · 2.6 KB
/
install.sh
File metadata and controls
102 lines (85 loc) · 2.6 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/sh
# Claude PeePee installation script for macOS and Linux
set -e
# Configuration
REPO="DandaAkhilReddy/claude_peepee"
INSTALL_DIR="${CLAUDE_PEEPEE_INSTALL_DIR:-$HOME/.local/bin}"
# Detect OS
detect_os() {
case "$(uname -s)" in
Linux*) echo "linux" ;;
Darwin*) echo "darwin" ;;
MINGW*|MSYS*|CYGWIN*) echo "windows" ;;
*) echo "unknown" ;;
esac
}
# Detect architecture
detect_arch() {
case "$(uname -m)" in
x86_64|amd64) echo "amd64" ;;
arm64|aarch64) echo "arm64" ;;
*) echo "unknown" ;;
esac
}
# Get latest release version
get_latest_version() {
curl -sL "https://api.github.com/repos/${REPO}/releases/latest" | \
grep '"tag_name":' | \
sed -E 's/.*"([^"]+)".*/\1/'
}
# Main installation
main() {
OS=$(detect_os)
ARCH=$(detect_arch)
if [ "$OS" = "unknown" ] || [ "$ARCH" = "unknown" ]; then
echo "Error: Unsupported platform: $(uname -s) $(uname -m)"
exit 1
fi
echo "Detected platform: ${OS}/${ARCH}"
# Get latest version
VERSION=$(get_latest_version)
if [ -z "$VERSION" ]; then
VERSION="v0.1.0"
echo "Warning: Could not detect latest version, using ${VERSION}"
else
echo "Latest version: ${VERSION}"
fi
# Construct download URL
BINARY="claude_peepee-${OS}-${ARCH}"
if [ "$OS" = "windows" ]; then
BINARY="${BINARY}.exe"
fi
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${VERSION}/${BINARY}"
# Create install directory
mkdir -p "$INSTALL_DIR"
# Download binary
echo "Downloading ${BINARY}..."
if command -v curl >/dev/null 2>&1; then
curl -sL "$DOWNLOAD_URL" -o "${INSTALL_DIR}/claude_peepee"
elif command -v wget >/dev/null 2>&1; then
wget -q "$DOWNLOAD_URL" -O "${INSTALL_DIR}/claude_peepee"
else
echo "Error: Neither curl nor wget found. Please install one of them."
exit 1
fi
# Make executable
chmod +x "${INSTALL_DIR}/claude_peepee"
echo ""
echo "Claude PeePee installed to ${INSTALL_DIR}/claude_peepee"
# Check if install dir is in PATH
case ":$PATH:" in
*":${INSTALL_DIR}:"*)
echo ""
echo "Run 'claude_peepee setup' to configure for your AI coding tool."
;;
*)
echo ""
echo "Add ${INSTALL_DIR} to your PATH:"
echo ""
echo " export PATH=\"\$PATH:${INSTALL_DIR}\""
echo ""
echo "Then run 'claude_peepee setup' to configure for your AI coding tool."
;;
esac
}
main "$@"