-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
51 lines (43 loc) · 1.36 KB
/
Copy pathinstall.sh
File metadata and controls
51 lines (43 loc) · 1.36 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
#!/bin/bash
echo "Checking for Python..."
if command -v python3 &> /dev/null; then
PYTHON_CMD="python3"
elif command -v python &> /dev/null; then
PYTHON_CMD="python"
else
echo "Python not found. Installing..."
mkdir -p "$(dirname "$0")/tools"
cd "$(dirname "$0")/tools"
if [[ "$(uname)" == "Darwin" ]]; then
if command -v brew &> /dev/null; then
brew install python3
PYTHON_CMD="python3"
else
echo "ERROR: On Mac use Homebrew: /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
exit 1
fi
else
if command -v apt-get &> /dev/null; then
sudo apt-get update
sudo apt-get install -y python3 python3-pip
PYTHON_CMD="python3"
elif command -v yum &> /dev/null; then
sudo yum install -y python3 python3-pip
PYTHON_CMD="python3"
else
echo "ERROR: Install Python manually"
exit 1
fi
fi
cd "$(dirname "$0")"
fi
echo "Installing Python dependencies..."
$PYTHON_CMD -m pip install flask flask-cors psutil 2>/dev/null || true
echo ""
echo "Installation complete!"
echo "Run: ./start.sh"
echo ""
read -p "Launch now? (Y/n): " RUN
if [ "$RUN" != "n" ] && [ "$RUN" != "N" ]; then
bash "$(dirname "$0")/start.sh"
fi