mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update install.sh
This commit is contained in:
@@ -2,11 +2,19 @@
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
|
||||
export PATH
|
||||
|
||||
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
|
||||
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
|
||||
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
P_VER=`python3 -V | awk '{print $2}'`
|
||||
echo "python:$P_VER"
|
||||
|
||||
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/pgadmin && bash install.sh install 4
|
||||
# cd /www/server/mdserver-web/plugins/pgadmin && bash install.sh install 4
|
||||
|
||||
@@ -43,12 +51,26 @@ fi
|
||||
|
||||
Install_pgadmin()
|
||||
{
|
||||
if [ -d $serverPath/pgadmin ];then
|
||||
exit 0
|
||||
fi
|
||||
# if [ -d $serverPath/pgadmin ];then
|
||||
# exit 0
|
||||
# fi
|
||||
|
||||
mkdir -p ${serverPath}/pgadmin
|
||||
if version_lt "$P_VER" "3.8.0" ;then
|
||||
echo 'Python版本太低,无法安装'
|
||||
fi
|
||||
PG_DIR=${serverPath}/pgadmin
|
||||
mkdir -p $PG_DIR
|
||||
echo "${1}" > ${serverPath}/pgadmin/version.pl
|
||||
|
||||
if [ ! -f $PG_DIR/bin/activate ];then
|
||||
if version_ge "$P_VER" "3.11.0" ;then
|
||||
echo "python3 > 3.11"
|
||||
cd $PG_DIR && python3 -m venv $PG_DIR
|
||||
else
|
||||
echo "python3 < 3.10"
|
||||
cd $PG_DIR && python3 -m venv .
|
||||
fi
|
||||
fi
|
||||
|
||||
VER=$1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user