Skip to content

Commit a42bab0

Browse files
committed
fix: make delete CLI path a --path option, clarify FTS guard comment
Reviewer feedback: - path as a second positional arg was unreachable (Click assigns left-to-right, so a path string would land in repo_id). Now --path/-p. - Added comment explaining fts is always initialized in lifespan, so the None guard is purely defensive.
1 parent ed0706e commit a42bab0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/cli/src/repowise/cli/commands/delete_cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@click.command("delete")
1818
@click.argument("repo_id", required=False, default=None)
1919
@click.option("--force", "-f", is_flag=True, default=False, help="Skip confirmation prompt.")
20-
@click.argument("path", required=False, default=None)
20+
@click.option("--path", "-p", default=None, help="Path to the repository directory.")
2121
def delete_command(repo_id: str | None, force: bool, path: str | None) -> None:
2222
"""Delete a repository and all its generated data."""
2323
repo_path = resolve_repo_path(path)

packages/server/src/repowise/server/routers/repos.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ async def delete_repo(
112112
# Collect page IDs before CASCADE deletes the Page rows
113113
page_ids = await crud.list_page_ids(session, repo_id)
114114

115-
# Clean up FTS index (FTS5 virtual table has no FK cascade)
115+
# Clean up FTS index (FTS5 virtual table has no FK cascade).
116+
# fts is always initialized in the lifespan before the server accepts
117+
# requests, so this guard is purely defensive.
116118
if fts is not None:
117119
await fts.delete_many(page_ids)
118120

0 commit comments

Comments
 (0)