feat: 前端下载前判断版本号是否获取成功

This commit is contained in:
DDSRem 2023-09-02 17:49:14 +08:00
parent 6befa35a26
commit ad5ca69bbb

8
update
View File

@ -22,6 +22,7 @@ if [ "${MOVIEPILOT_AUTO_UPDATE_DEV}" = "true" ]; then
echo "安装依赖成功"
# 检查前端最新版本
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name)
if [[ "${frontend_version}" == *v* ]]; then
echo "正在下载前端程序 ${frontend_version}..."
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" | busybox unzip -d /tmp -
if [ $? -eq 0 ]; then
@ -34,6 +35,9 @@ if [ "${MOVIEPILOT_AUTO_UPDATE_DEV}" = "true" ]; then
else
echo "前端程序下载失败,继续使用旧的程序来启动..."
fi
else
echo "前端最新版本号获取失败,继续启动..."
fi
else
echo "安装依赖失败,请重新拉取镜像"
fi
@ -63,6 +67,7 @@ else
echo "安装依赖成功"
# 检查前端最新版本
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name)
if [[ "${frontend_version}" == *v* ]]; then
echo "正在下载前端程序 ${frontend_version}..."
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" | busybox unzip -d /tmp -
if [ $? -eq 0 ]; then
@ -75,6 +80,9 @@ else
else
echo "前端程序下载失败,继续使用旧的程序来启动..."
fi
else
echo "前端最新版本号获取失败,继续启动..."
fi
else
echo "安装依赖失败,请重新拉取镜像"
fi