From 8f6c8f6f148a108cbbe11892fffc5cef729526c4 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 31 Oct 2024 14:16:53 +0000 Subject: feat(init): simplify maintainer selection by first asking if the user is the only maintainer and if so not showing the npub selection option --- src/bin/ngit/sub_commands/init.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/bin/ngit') diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index 1519132..05160a8 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs @@ -246,6 +246,20 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { } }; 'outer: loop { + if !dont_ask + && signer + .public_key() + .await? + .to_bech32()? + .eq(&maintainers_string) + && Interactor::default().confirm( + PromptConfirmParms::default() + .with_prompt("are you the only maintainer?") + .with_default(true), + )? + { + dont_ask = true; + } if !dont_ask { println!("{}", &maintainers_string); maintainers_string = Interactor::default().input( -- cgit v1.2.3