mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🩹 修改数据库路径检测
This commit is contained in:
parent
d598e1c59a
commit
12660df8c3
@ -55,7 +55,7 @@ async def _(setting: Setting) -> Result:
|
||||
base_dir = Path().resolve()
|
||||
db_path = Path(setting.db_url.split(":")[-1])
|
||||
parent_path = db_path.parent
|
||||
if parent_path.is_absolute() and not parent_path.is_relative_to(base_dir):
|
||||
if not parent_path.absolute().is_relative_to(base_dir):
|
||||
return Result.fail("数据库路径不在项目根目录内。")
|
||||
parent_path.mkdir(parents=True, exist_ok=True)
|
||||
env_text = env_text.replace('DB_URL = ""', f'DB_URL = "{setting.db_url}"')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user