-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_mac.command
More file actions
executable file
·72 lines (61 loc) · 1.8 KB
/
install_mac.command
File metadata and controls
executable file
·72 lines (61 loc) · 1.8 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
#!/bin/bash
cd "$(dirname "$0")"
echo "=========================================================="
echo " P2Ply Universal Installer (MacOS)"
echo "=========================================================="
echo ""
echo "[!] IMPORTANT: PLEASE TURN ON YOUR VPN NOW! [!]"
echo ""
echo "Press ENTER to continue..."
read
# Helper function
exists() {
command -v "$1" >/dev/null 2>&1
}
# 1. Check & Install Git
if ! exists git; then
echo "[!] Git not found. Triggering Xcode command line tools install..."
xcode-select --install
echo "Please run this script again after installation completes."
exit 1
fi
# 2. Check Homebrew (Required for easy automation)
if ! exists brew; then
if ! exists python3 || ! exists node; then
echo "[!] Homebrew is missing. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add brew to path for this session if needed
eval "$(/opt/homebrew/bin/brew shellenv)" 2>/dev/null
eval "$(/usr/local/bin/brew shellenv)" 2>/dev/null
fi
fi
# 3. Check & Install Python
if ! exists python3; then
echo "[!] Python 3 not found. Installing via Homebrew..."
brew install python
fi
# 4. Check & Install Node.js
if ! exists node; then
echo "[!] Node.js not found. Installing via Homebrew..."
brew install node
fi
echo ""
echo "[+] All tools are ready."
# 5. Clone or Update Repo
if [ -d "p2ply" ]; then
echo "[*] Updating p2ply..."
cd p2ply
git pull
else
echo "[*] Cloning p2ply repository..."
git clone https://github.com/DeepPythonist/p2ply.git
cd p2ply
fi
# 6. Install Dependencies & Run
echo ""
echo "[*] Installing project dependencies..."
npm install
echo ""
echo "[*] Launching P2Ply..."
# Ensure browser open works
python3 launcher.py