upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands/init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ngit/sub_commands/init.rs')
-rw-r--r--src/bin/ngit/sub_commands/init.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs
index aa43106..146a29c 100644
--- a/src/bin/ngit/sub_commands/init.rs
+++ b/src/bin/ngit/sub_commands/init.rs
@@ -6,7 +6,7 @@ use nostr::{nips::nip01::Coordinate, FromBech32, PublicKey, ToBech32};
6use nostr_sdk::Kind; 6use nostr_sdk::Kind;
7 7
8use crate::{ 8use crate::{
9 cli::Cli, 9 cli::{extract_signer_cli_arguments, Cli},
10 cli_interactor::{Interactor, InteractorPrompt, PromptInputParms}, 10 cli_interactor::{Interactor, InteractorPrompt, PromptInputParms},
11 client::{fetching_with_report, get_repo_ref_from_cache, send_events, Client, Connect}, 11 client::{fetching_with_report, get_repo_ref_from_cache, send_events, Client, Connect},
12 git::{nostr_url::convert_clone_url_to_https, Repo, RepoActions}, 12 git::{nostr_url::convert_clone_url_to_https, Repo, RepoActions},
@@ -69,7 +69,8 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
69 69
70 let repo_ref = if let Some(repo_coordinates) = repo_coordinates.clone() { 70 let repo_ref = if let Some(repo_coordinates) = repo_coordinates.clone() {
71 fetching_with_report(git_repo_path, &client, &repo_coordinates).await?; 71 fetching_with_report(git_repo_path, &client, &repo_coordinates).await?;
72 if let Ok(repo_ref) = get_repo_ref_from_cache(git_repo_path, &repo_coordinates).await { 72 if let Ok(repo_ref) = get_repo_ref_from_cache(Some(git_repo_path), &repo_coordinates).await
73 {
73 Some(repo_ref) 74 Some(repo_ref)
74 } else { 75 } else {
75 None 76 None
@@ -78,15 +79,11 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
78 None 79 None
79 }; 80 };
80 81
81 let (signer, user_ref) = login::launch( 82 let (signer, user_ref, _) = login::login_or_signup(
82 &git_repo, 83 &Some(&git_repo),
83 &cli_args.bunker_uri, 84 &extract_signer_cli_arguments(cli_args).unwrap_or(None),
84 &cli_args.bunker_app_key,
85 &cli_args.nsec,
86 &cli_args.password, 85 &cli_args.password,
87 Some(&client), 86 Some(&client),
88 false,
89 false,
90 ) 87 )
91 .await?; 88 .await?;
92 89
@@ -381,7 +378,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
381 378
382 send_events( 379 send_events(
383 &client, 380 &client,
384 git_repo_path, 381 Some(git_repo_path),
385 vec![repo_event], 382 vec![repo_event],
386 user_ref.relays.write(), 383 user_ref.relays.write(),
387 relays.clone(), 384 relays.clone(),