fix:windows7_start.cmd

This commit is contained in:
david 2021-03-19 13:16:00 +08:00
parent 3d40004518
commit fa0f86d1af

View File

@ -11,48 +11,6 @@ echo Token: https://iyuu.cn
echo Blog: https://www.iyuu.cn
echo Docs: http://api.iyuu.cn/docs.php
echo.
goto :ping
:ping
echo "正在检查网络,请耐心等待..."
ping demo.iyuu.cn
echo.
goto :checkEnv
:checkEnv
echo "检查.env.example文件是否存在..."
if exist "%~dp0.env.example" goto :checkGit
echo "检查GIT尝试安装源码..."
git --version|find "git version">nul&&goto :install
goto :installError
:install
echo "正在使用GIT下载源码..."
git clone https://gitee.com/ledc/iyuuplus.git %~dp0IYUUPlus
echo "通过GIT安装完成开始检测php执行程序..."
cd IYUUPlus
goto :checkPHP
:installError
cls
echo "当前运行环境未检测到GIT程序源码安装失败请手动下载"
echo "Docker: https://hub.docker.com/r/iyuucn/iyuuplus"
echo "Gitee: https://gitee.com/ledc/iyuuplus"
echo "Github: https://github.com/ledccn/IYUUPlus"
pause
goto :end
:checkGit
echo "检查GIT程序尝试自动更新源码..."
git --version|find "git version">nul&&goto :pull
cls
echo "当前IYUUPlus运行环境未检测到git程序不支持自动更新。"
echo "推荐您使用git来下载代码库"
echo "您可以在安装git程序后在命令行内输入"
echo "git clone https://gitee.com/ledc/iyuuplus.git"
goto :checkPHP
:pull
echo "正在检测源码库的git特征文件..."
if exist "%~dp0.git\config" (
echo "正在为您自动更新..."
@ -68,16 +26,6 @@ goto :checkPHP
:checkPHP
if exist "%~dp0php\php.exe" (set PHP_BINARY=%~dp0php\php.exe) else (set PHP_BINARY=php.exe)
echo "PHP二进制程序"%PHP_BINARY%
%PHP_BINARY% -v|find "PHP Group">nul&&goto :start
cls
echo "没有检测到PHP执行程序"
echo "如果您已下载过php程序请在解压缩后把php文件夹添加进系统的环境变量。"
echo "或者把php执行程序解压缩到当前目录下的php文件夹。"
echo "脚本运行终止!!!"
pause
goto :end
:start
%PHP_BINARY% -v
echo.
echo "如果您需要停止程序请按下组合键CTRL + C"