-
Notifications
You must be signed in to change notification settings - Fork 0
/
Filmatyk_linux.sh
42 lines (39 loc) · 974 Bytes
/
Filmatyk_linux.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
#!/bin/bash
# Filmatyk launch script
# It is much easier under Linux, since we don't have to deal with pythonw, just
# try for python3 or python and check their versions. Plus, bash has functions.
# Also, we don't print detailed error messages here.
test_cmd_ver () {
# Tests whether $1 points to a proper Python 3.6 interpreter.
_p=$(which $1)
if [ $? -ne 0 ]; then
status=3
else
$1 tools/pytest.py
status=$?
fi
echo $status
}
# Try python3
found=$(test_cmd_ver python3)
if [ $found -ne 0 ]; then
# In case of failure - python as last resort
found=$(test_cmd_ver python)
if [ $found -ne 0]; then
echo "Unable to find a Python 3.6+ interpreter"
exit $found
else
pycmd=python
fi
else
pycmd=python3
fi
# Check dependencies
$pycmd tools/deptest.py
if [ -f install.txt ]; then
$pycmd -m pip install -r install.txt
rm install.txt
fi
# Ready to launch
cd filmatyk
$pycmd gui.py linux $1 # pass $1 as it might be a debug flag