-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTertris.sh
executable file
·41 lines (37 loc) · 998 Bytes
/
Tertris.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
#!/bin/bash
quit_app(){
echo "Starting canceled."
exit 1
}
# checking that Python 3 is available
if ! python3 --version > /dev/null 2>&1
then
echo "Error: Python 3 not installed (unavailable with the python3 command)."
read -rp "Install Python 3? (Y/n) " install_py
if [ "$install_py" != "N" ] && [ "$install_py" != "n" ]
then
echo -n "Python3 installation..."
if type apt > /dev/null 2>&1
then
echo "with apt"
sudo apt-get install python3
elif type yum > /dev/null 2>&1
then
echo "with yum"
sudo yum install python3
elif type pacman > /dev/null 2>&1
then
echo "with pacman"
sudo pacman -Sy python3
else
echo "failure: no supported package manager detected. Try by yourself."
echo "Python 3 not installed."
quit_app
fi;
else
echo "This app needs Python 3."
quit_app
fi;
fi;
# starting the app
python3 "$(dirname "$(readlink -f "$0")")/src/main.py"