pick first if one workspace, log no workspaces
This commit is contained in:
parent
c0f0a172c7
commit
1d87aa091c
1 changed files with 10 additions and 0 deletions
|
|
@ -510,6 +510,12 @@ def pick_repo_with_iterfzf(repos: list[Path]) -> Path | None:
|
|||
return None
|
||||
|
||||
names = [r.name for r in repos]
|
||||
if len(names) == 1:
|
||||
return repos[0]
|
||||
elif not names:
|
||||
console.print("[red]No repos found.[/red]")
|
||||
console.print("Use 'workspaces add' to add repos.")
|
||||
return None
|
||||
choice = iterfzf(names, prompt="pick a repo> ")
|
||||
|
||||
if not choice:
|
||||
|
|
@ -1368,6 +1374,10 @@ def clean_workspace(
|
|||
repos = [directory for directory in ws_dir.iterdir() if directory.is_dir()]
|
||||
repo = pick_repo_with_iterfzf(repos)
|
||||
|
||||
if not repo:
|
||||
console.print("[red]No repo selected.[/red]")
|
||||
raise typer.Exit(1)
|
||||
|
||||
title, _desc = read_workspace_readme(ws_dir)
|
||||
console.print(
|
||||
f"Cleaning workspace [bold]{title or ws_dir.name}[/bold] (dir: {repo.name})"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue