-
Notifications
You must be signed in to change notification settings - Fork 3
/
install
executable file
·45 lines (38 loc) · 1.18 KB
/
install
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
#!/bin/bash
echo "Checking if Python exists"
# Check for Python 3 and assign its path to a variable
if command -v python3 > /dev/null 2>&1; then
py=$(which python3)
echo "Using python3"
else
if python --version 2>&1 | grep -q '3.'; then
py=$(which python)
echo "Using python"
else
echo "Please install Python3 or 3.11 manually."
exit 1
fi
fi
echo "Installing required components"
# Create a virtual environment in the current directory
$py -m venv venv
# Dynamically get the current directory's virtual environment activation script
VENV_DIR="$PWD/venv"
if [ -d "$VENV_DIR" ]; then
echo "Activating virtual environment in $VENV_DIR"
source "$VENV_DIR/bin/activate"
else
echo "Virtual environment not found in $VENV_DIR"
exit 1
fi
# Install required Python packages
"$VENV_DIR/bin/pip" install --upgrade streamlink aiohttp aiofiles orjson uvloop
# Deactivate the virtual environment
deactivate
echo "Required components installation completed!"
echo "Starting configuration"
# Execute the settings script
bash settings
echo "Configuration completed!"
echo "If you want to reconfigure, please run the \"settings\" script directly"
exit 0