-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
66 lines (51 loc) · 1.49 KB
/
install.sh
File metadata and controls
66 lines (51 loc) · 1.49 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
#!/bin/bash
# Prompd CLI Installer Script
set -e
# Configuration
REPO="Logikbug/prompt-markdown"
BINARY_NAME="prompd"
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
# Detect platform
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case $ARCH in
x86_64) ARCH="amd64" ;;
aarch64|arm64) ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
esac
# Get latest release
echo "🔍 Finding latest release..."
LATEST_URL="https://api.github.com/repos/$REPO/releases/latest"
RELEASE_INFO=$(curl -s $LATEST_URL)
VERSION=$(echo $RELEASE_INFO | grep -o '"tag_name": "[^"]*' | cut -d'"' -f4)
if [ -z "$VERSION" ]; then
echo "❌ Could not determine latest version"
exit 1
fi
echo "📦 Latest version: $VERSION"
# Download URL
if [ "$OS" = "darwin" ]; then
PLATFORM="darwin"
elif [ "$OS" = "linux" ]; then
PLATFORM="linux"
else
echo "❌ Unsupported platform: $OS"
exit 1
fi
ARCHIVE_NAME="prompd-${PLATFORM}-${ARCH}.tar.gz"
DOWNLOAD_URL="https://github.com/$REPO/releases/download/$VERSION/$ARCHIVE_NAME"
echo "⬇️ Downloading $ARCHIVE_NAME..."
# Create temp directory
TMP_DIR=$(mktemp -d)
cd $TMP_DIR
# Download and extract
curl -sL "$DOWNLOAD_URL" -o "$ARCHIVE_NAME"
tar -xzf "$ARCHIVE_NAME"
# Install
echo "📦 Installing to $INSTALL_DIR..."
sudo mv "prompd-${PLATFORM}-${ARCH}" "$INSTALL_DIR/$BINARY_NAME"
sudo chmod +x "$INSTALL_DIR/$BINARY_NAME"
# Cleanup
rm -rf $TMP_DIR
echo "✅ Prompd CLI installed successfully!"
echo "🚀 Try: $BINARY_NAME --help"