From f2158cd36e30b3b88c83e3fc72916057c0d0329f Mon Sep 17 00:00:00 2001 From: xiamuceer Date: Mon, 29 Dec 2025 15:19:14 +0800 Subject: [PATCH] =?UTF-8?q?update:1.=E6=9B=B4=E6=96=B0=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E9=94=AE=E6=9C=AC=EF=BC=8C=E4=BB=8Eenv=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/scripts/entrypoint.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/backend/scripts/entrypoint.sh b/backend/scripts/entrypoint.sh index 58b5bc2..eb4c0d0 100644 --- a/backend/scripts/entrypoint.sh +++ b/backend/scripts/entrypoint.sh @@ -4,9 +4,22 @@ set -e # 遇到错误立即退出 -# 获取版本信息(从环境变量) -APP_VERSION="${APP_VERSION:-1.0.0}" -APP_NAME="${APP_NAME:-MuMuAINovel}" +# 获取版本信息(从 .env.example 文件) +# 如果环境变量未设置,则从 .env.example 读取 +if [ -z "$APP_VERSION" ]; then + if [ -f "/app/.env.example" ]; then + APP_VERSION=$(grep "^APP_VERSION=" /app/.env.example | cut -d '=' -f2) + fi + APP_VERSION="${APP_VERSION:-1.0.0}" +fi + +if [ -z "$APP_NAME" ]; then + if [ -f "/app/.env.example" ]; then + APP_NAME=$(grep "^APP_NAME=" /app/.env.example | cut -d '=' -f2) + fi + APP_NAME="${APP_NAME:-MuMuAINovel}" +fi + BUILD_TIME=$(date '+%Y-%m-%d %H:%M:%S') echo "================================================"