forked from FaqFirebase/pi-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·103 lines (89 loc) · 2.65 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·103 lines (89 loc) · 2.65 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
103
#!/bin/bash
# Pi Desktop — Quick Install Script
# Usage: curl -fsSL https://raw.githubusercontent.com/FaqFirebase/pi-desktop/master/install.sh | bash
set -e
REPO="FaqFirebase/pi-desktop"
BINARY_NAME="pi-desktop"
INSTALL_DIR="${HOME}/.local/bin"
echo "╔═══════════════════════════════════════╗"
echo "║ Pi Desktop — Installer ║"
echo "╚═══════════════════════════════════════╝"
echo ""
# Detect platform
OS="$(uname -s)"
ARCH="$(uname -m)"
case "$OS" in
Linux*)
PLATFORM="linux"
if [ "$ARCH" = "x86_64" ]; then
ARCH_NAME="x64"
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
ARCH_NAME="arm64"
else
echo "Error: Unsupported architecture: $ARCH"
exit 1
fi
;;
Darwin*)
PLATFORM="mac"
if [ "$ARCH" = "x86_64" ]; then
ARCH_NAME="x64"
elif [ "$ARCH" = "arm64" ]; then
ARCH_NAME="arm64"
fi
;;
MINGW*|MSYS*|CYGWIN*)
PLATFORM="win"
ARCH_NAME="x64"
;;
*)
echo "Error: Unsupported OS: $OS"
echo "Please download manually from: https://github.com/$REPO/releases"
exit 1
;;
esac
echo "Platform: $PLATFORM-$ARCH_NAME"
# Check for Pi dependency
if ! command -v pi &> /dev/null; then
echo ""
echo "⚠ Pi is not installed."
echo " Installing Pi first..."
echo ""
curl -fsSL https://pi.dev/install.sh | sh
echo ""
fi
echo "✓ Pi found: $(which pi)"
# Download the latest release artifact for this platform.
# Pi Desktop is distributed as a packaged binary, not via npm — see MEMORY.md.
if [ "$PLATFORM" = "linux" ]; then
echo ""
echo "Downloading AppImage..."
DOWNLOAD_URL="https://github.com/$REPO/releases/latest/download/Pi-Desktop-${PLATFORM}-${ARCH_NAME}.AppImage"
mkdir -p "$INSTALL_DIR"
OUTPUT="$INSTALL_DIR/$BINARY_NAME"
echo "Downloading: $DOWNLOAD_URL"
curl -fsSL "$DOWNLOAD_URL" -o "$OUTPUT"
chmod +x "$OUTPUT"
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo ""
echo "Add to your PATH:"
echo " export PATH=\"$INSTALL_DIR:\$PATH\""
echo ""
echo "Add to ~/.bashrc or ~/.zshrc to make permanent."
fi
echo ""
echo "✓ Pi Desktop installed to $OUTPUT"
echo ""
echo "Run: $OUTPUT"
echo ""
else
echo ""
echo "Automated install is currently Linux-only."
echo "Download the installer for $PLATFORM from: https://github.com/$REPO/releases"
echo ""
echo "Or build from source:"
echo " git clone https://github.com/$REPO.git"
echo " cd pi-desktop"
echo " npm install && npm run package:$PLATFORM"
exit 1
fi