-
-
Notifications
You must be signed in to change notification settings - Fork 179
/
install.sh
executable file
·49 lines (42 loc) · 1.29 KB
/
install.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
49
#!/usr/bin/env bash
if [ "$1" = "--reverse" ]
then
cd autoload/leaderf/fuzzyMatch_C
rm -rf build
rm -f ../python/*.so ../python/*.dll
echo ========================================
echo ^_^ C extension uninstalled successfully!
echo ========================================
exit 0
fi
no_python=true
cd autoload/leaderf/fuzzyMatch_C
if command -v python2 > /dev/null 2>&1; then
no_python=false
echo "Begin to compile C extension of Python2 ..."
python2 setup.py build --build-lib ../python
if [ $? -eq 0 ]
then
echo
echo =================================================
echo ^_^ C extension of Python2 installed successfully!
echo =================================================
fi
fi
if command -v python3 > /dev/null 2>&1; then
$no_python || echo
no_python=false
echo "Begin to compile C extension of Python3 ..."
python3 setup.py build --build-lib ../python
if [ $? -eq 0 ]
then
echo
echo =================================================
echo ^_^ C extension of Python3 installed successfully!
echo =================================================
fi
fi
if $no_python; then
echo "Can't compile C extension, please install Python2 or Python3" >&2
exit 1
fi