fix(tools): resolve config path inside container
This commit is contained in:
1 parent
b0aa919e18
commit
55c40db047
3 files changed
+20
-2
No files matched your search
@@ -224,7 +224,13 @@ def _database_path(config_path: str, override: str | None) -> Path:
|
||||
return Path(override)
|
||||
from reaction_board.config import ConfigStore
|
||||
|
||||
return ConfigStore(config_path, require_auth=False).get().storage.database_path
|
||||
candidates = [Path(config_path), Path("/config/config.json")]
|
||||
for candidate in candidates:
|
||||
if candidate.exists():
|
||||
return ConfigStore(str(candidate), require_auth=False).get().storage.database_path
|
||||
raise ValueError(
|
||||
"找不到配置文件;请用 --db /data/app.db 或 --config /config/config.json"
|
||||
)
|
||||
|
||||
|
||||
def main(argv: Sequence[str] | None = None) -> int:
|
||||
|
||||
Reference in new issue
Block a user