1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +00:00

Merge pull request #5159 from haiwen/seahub-sh

update seahub.sh make Seafile be compatible with Python 3.10
This commit is contained in:
Daniel Pan
2022-03-30 10:02:42 +08:00
committed by GitHub

View File

@@ -57,14 +57,20 @@ function check_python_executable() {
if which python3 2>/dev/null 1>&2; then
PYTHON=python3
elif !(python --version 2>&1 | grep "3\.[0-9]\.[0-9]") 2>/dev/null 1>&2; then
elif !(python --version 2>&1 | grep "3\.[0-9]\+\.[0-9]\+") 2>/dev/null 1>&2; then
echo
echo "The current version of python is not 3.x.x, please use Python 3.x.x ."
echo
exit 1
else
# Python 3.8.10
PYTHON="python"$(python --version | cut -b 8-10)
if !which $PYTHON 2>/dev/null 1>&2; then
if !(which $PYTHON) 2>/dev/null 1>&2; then
# Python 3.10.4
PYTHON="python"$(python --version | cut -b 8-11)
fi
if !(which $PYTHON) 2>/dev/null 1>&2; then
echo
echo "Can't find a python executable of $PYTHON in PATH"
echo "Install $PYTHON before continue."