-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpss.sh
executable file
·48 lines (37 loc) · 1023 Bytes
/
pss.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
48
#!/bin/bash
cd $(cd "$(dirname "$BASH_SOURCE")"; cd -P "$(dirname "$(readlink "$BASH_SOURCE" || echo .)")"; pwd)
SPIN='-\|/'
spin() {
while true; do
printf "\r>> [${SPIN:i++%${#SPIN}:1}] \033[0;33mPSS\033[0m ($pssmsg_python_version) is starting: $pssmsg"
sleep 0.1
done
}
echo ' _____ ______ ______ '
echo '| || ___|| ___|'
echo '| _| `-.`-. `-.`-. '
echo '|___| |______||______|'
if command -v python3.12 &>/dev/null; then
python_version="python3.12"
else
python_version="python3"
fi
pssmsg_python_version=$($python_version -V)
pssmsg="Initializing venv..."
spin &
SPIN_PID=$!
if [ ! -d ".pss-venv" ]; then
$python_version -m venv .pss-venv
fi
source .pss-venv/bin/activate
kill $SPIN_PID
pssmsg="Installing/Updating requirements..."
spin &
SPIN_PID=$!
if [ -f "requirements.txt" ]; then
$python_version -m pip install -r requirements.txt -U -q
fi
kill $SPIN_PID
clear
$python_version pss.py $@
deactivate