-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
45 lines (35 loc) · 911 Bytes
/
run.sh
File metadata and controls
45 lines (35 loc) · 911 Bytes
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
if ! command -v python3 &> /dev/null; then
echo "Installing python3..."
sudo apt update
sudo apt install -y python3
fi
if ! command -v pip3 &> /dev/null; then
echo "Installing pip3..."
sudo apt update
sudo apt install -y python3-pip
fi
if ! dpkg -l | grep -q python3-venv; then
echo "Installing python3-venv..."
sudo apt update
sudo apt install -y python3-venv
fi
if ! dpkg -l | grep -q python3-tk; then
echo "Installing python3-tk..."
sudo apt update
sudo apt install -y python3-tk
fi
if [ ! -d ".venv" ]; then
echo "Creating virtual environment .venv..."
python3 -m venv .venv
fi
source .venv/bin/activate
if [ -f "requirements.txt" ]; then
echo "Running pip commands. This may take a while..."
pip install -q --upgrade pip
pip install -q -r requirements.txt --upgrade
fi
if [ -f "spotifyscheduler.py" ]; then
python spotifyscheduler.py
fi
deactivate