-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrun.sh
executable file
·44 lines (34 loc) · 1.07 KB
/
run.sh
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
#!/bin/bash
# PixelLlama info
echo "PixelLlama - version 0.95b"
echo "Launching PixelLlama..."
# Set the name of your virtual environment
VENV_NAME=".venv"
# Check if the virtual environment exists by looking for pyvenv.cfg
if [ ! -f "$VENV_NAME/bin/python" ]; then
echo "Creating virtual environment..."
python3 -m venv "$VENV_NAME"
fi
# Activate the virtual environment
source "$VENV_NAME/bin/activate"
# Check if required packages are installed by comparing installed versions
for i in PyQt6 PyQt6-WebEngine requests; do
pip show "$i" > /dev/null 2>&1
if [ $? -ne 0 ]; then
need_install=1
fi
done
# Check if requirements are installed
REQUIREMENTS_FILE="requirements.txt"
# Install or upgrade the required packages only if needed
if [ -n "$need_install" ]; then
echo "Installing/Upgrading required packages..."
pip install -r "$REQUIREMENTS_FILE"
fi
# Run the Python script using python
echo "Running PixelLlama..."
python main.py "$@"
# Deactivate the virtual environment
deactivate
# Exit the script
exit