修正.env.prod和.env.dev的生成

This commit is contained in:
Pliosauroidea
2025-03-11 18:37:40 +08:00
parent 2e3411f103
commit 4cc5c8ef2c

10
bot.py
View File

@@ -51,15 +51,15 @@ def init_env():
with open(".env", "w") as f:
f.write("ENVIRONMENT=prod")
# 检测.env.prod文件是否存在
if not os.path.exists(".env.prod"):
logger.error("检测到.env.prod文件不存在")
shutil.copy("template.env", "./.env.prod")
# 检测.env.prod文件是否存在
if not os.path.exists(".env.prod"):
logger.error("检测到.env.prod文件不存在")
shutil.copy("template.env", "./.env.prod")
# 检测.env.dev文件是否存在不存在的话直接复制生产环境配置
if not os.path.exists(".env.dev"):
logger.error("检测到.env.dev文件不存在")
shutil.copy(".env.prod", "./.env.dev")
shutil.copy("template.env", "./.env.dev")
# 首先加载基础环境变量.env
if os.path.exists(".env"):