ankisyncd.sh: Look for 'python2' before checking the version of 'python'
This commit is contained in:
parent
0311e25574
commit
8c3a53c3f4
15
ankisyncd.sh
15
ankisyncd.sh
@ -1,15 +1,20 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
export PYTHONPATH="/usr/share/ankisyncd"
|
export PYTHONPATH="/usr/share/ankisyncd"
|
||||||
export PYTHON="python"
|
export PYTHON="python2"
|
||||||
|
|
||||||
if [ $(python -V 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1) -ne 2 ]; then
|
which python2 > /dev/null
|
||||||
which python2 > /dev/null
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
PYTHON="python2"
|
which python > /dev/null
|
||||||
|
|
||||||
|
if [ $? -ne 0 -a \
|
||||||
|
$($PYTHON -V 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1) -ne 2 ]; then
|
||||||
|
PYTHON="python"
|
||||||
else
|
else
|
||||||
echo "$0: Cannot find Python 2" 1>&2
|
echo "$0: Cannot find Python 2" 1>&2
|
||||||
|
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user