-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaafm
executable file
·53 lines (42 loc) · 1.26 KB
/
aafm
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
49
50
51
52
#!/bin/sh
executable=""
site_path=""
#Check the correct name for python2 interpreter, assume no one uses in distro with python
#version lower than 2.5.0
which python > /dev/null 2>&1
if [ "$?" == "0" ]; then
version=$(python -c 'import sys; print(sys.version[:1])')
if [ "$version" = "2" ]; then
executable=python
fi
fi
which python2 > /dev/null 2>&1
if [ "$?" = "0" ]; then
executable=python2
fi
which python2.5 > /dev/null 2>&1
if [ "$?" = "0" ]; then
executable=python2.5
fi
which python2.6 > /dev/null 2>&1
if [ "$?" = "0" ]; then
executable=python2.6
fi
which python2.7 > /dev/null 2>&1
if [ "$?" = "0" ]; then
executable=python2.7
else
if [ "$executable" = "" ]; then
echo "Could not find the python executable to run the application with."
echo "Please enter the python 2 interpreter executable's name or press enter to exit"
read executable
if [ "$executable" = "" ]; then
echo "Please install a python2 interpreter and try again. Exiting!"
exit 1
fi
fi
fi
#Assume we have actually installed aafm to the site-packages dir....
site_path="$($executable -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")"
#Launch Aafm from site-packages path and pass any arguments given
$executable "${site_path}/aafm/aafm-gui.py" "$@"