update:1.更新启动键本,从env获取版本号

This commit is contained in:
xiamuceer
2025-12-29 15:19:14 +08:00
parent f4dd3dad13
commit f2158cd36e
+16 -3
View File
@@ -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 "================================================"