-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·47 lines (35 loc) · 908 Bytes
/
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
45
46
47
#!/bin/bash
# exports
source credentials.sh
# activate env
source $CONDA_PATH
conda activate endurabeats
if [[ -n $SPOTIFY_CLIENT_ID ]]; then
echo "Spotify credentials set"
else
echo "Spotify credentials not set"
#exit 1
fi
if [[ -n $STRAVA_CLIENT_ID ]]; then
echo "Strava credentials set"
else
echo "Strava credentials not set"
#exit 1
fi
# Start Flask login app in the background
echo "Starting login client..."
python src/login.py &
# Save the process ID of the Flask app
FLASK_PID=$!
# Wait for Flask app to start up (you may need to adjust the sleep duration)
sleep 3
# Run authorize.py
echo "Running authorization workflow..."
python src/authorize.py > logs/auth.log
# Kill the Flask server
echo "Killing login client..."
kill $FLASK_PID
# Run tracklists.py
echo "Updating tracklists..."
python src/tracklists.py > logs/tracklists.log
echo "Exiting endurabeats..."