From 1d87aa091cab6e5d95ff2c523753f16cde246709 Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Fri, 28 Nov 2025 11:10:28 -0600 Subject: [PATCH] pick first if one workspace, log no workspaces --- workspaces.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/workspaces.py b/workspaces.py index e3a53d2..db58cad 100755 --- a/workspaces.py +++ b/workspaces.py @@ -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})"