Merge pull request #1 from TySP-Dev/claude/create-data-directories-1ktvx
Ensure data/, data/exports/, and data/downloads/ are created at startup
This commit is contained in:
@@ -82,6 +82,13 @@ def main(
|
||||
# Setup
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def _ensure_data_dirs() -> None:
|
||||
"""Create data/, data/exports/, and data/downloads/ if they don't exist."""
|
||||
base = Path(__file__).parent / "data"
|
||||
for sub in ("", "exports", "downloads"):
|
||||
(base / sub).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def _run_setup() -> None:
|
||||
if cfg.config_exists():
|
||||
overwrite = typer.confirm(
|
||||
@@ -90,6 +97,8 @@ def _run_setup() -> None:
|
||||
if not overwrite:
|
||||
raise typer.Abort()
|
||||
|
||||
_ensure_data_dirs()
|
||||
|
||||
# Ensure the export CLI is present before finishing setup
|
||||
try:
|
||||
tools.ensure_export_cli()
|
||||
@@ -110,6 +119,8 @@ def _run_setup() -> None:
|
||||
def _start_service(run_now: bool = False) -> None:
|
||||
global _master_password
|
||||
|
||||
_ensure_data_dirs()
|
||||
|
||||
# Verify the export CLI is present (offers download if missing)
|
||||
try:
|
||||
tools.ensure_export_cli()
|
||||
|
||||
Reference in New Issue
Block a user