From 115eca3d69310a58e8357fe091183d0a8e723967 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 14 Feb 2024 16:44:56 +0000 Subject: feat: find repo event by nevent or naddr if repo event cannot be found using unique commit the user can find it via a nevent or naddr also handle no PRs found --- src/sub_commands/list.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sub_commands') diff --git a/src/sub_commands/list.rs b/src/sub_commands/list.rs index 49cbf6d..47a8fdc 100644 --- a/src/sub_commands/list.rs +++ b/src/sub_commands/list.rs @@ -51,6 +51,11 @@ pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> { let pr_events: Vec = find_pr_events(&client, &repo_ref, &root_commit.to_string()).await?; + if pr_events.is_empty() { + println!("no PRs found... create one? try `ngit send`"); + return Ok(()); + } + let selected_index = Interactor::default().choice( PromptChoiceParms::default() .with_prompt("All PRs") -- cgit v1.2.3