diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/login/fresh.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/login/fresh.rs b/src/lib/login/fresh.rs index 62622a8..458b0f9 100644 --- a/src/lib/login/fresh.rs +++ b/src/lib/login/fresh.rs | |||
| @@ -146,6 +146,7 @@ pub async fn get_fresh_nsec_signer() -> Result< | |||
| 146 | match Interactor::default().choice( | 146 | match Interactor::default().choice( |
| 147 | PromptChoiceParms::default() | 147 | PromptChoiceParms::default() |
| 148 | .with_default(0) | 148 | .with_default(0) |
| 149 | .with_prompt("login to nostr") | ||
| 149 | .with_choices(vec!["try again with nsec".to_string(), "back".to_string()]) | 150 | .with_choices(vec!["try again with nsec".to_string(), "back".to_string()]) |
| 150 | .dont_report(), | 151 | .dont_report(), |
| 151 | )? { | 152 | )? { |
| @@ -187,6 +188,7 @@ pub async fn get_fresh_nsec_signer() -> Result< | |||
| 187 | match Interactor::default().choice( | 188 | match Interactor::default().choice( |
| 188 | PromptChoiceParms::default() | 189 | PromptChoiceParms::default() |
| 189 | .with_default(0) | 190 | .with_default(0) |
| 191 | .with_prompt("login to nostr") | ||
| 190 | .with_choices(vec!["try again with nsec".to_string(), "back".to_string()]) | 192 | .with_choices(vec!["try again with nsec".to_string(), "back".to_string()]) |
| 191 | .dont_report(), | 193 | .dont_report(), |
| 192 | )? { | 194 | )? { |
| @@ -488,10 +490,13 @@ async fn save_to_git_config( | |||
| 488 | signer_info: &SignerInfo, | 490 | signer_info: &SignerInfo, |
| 489 | global: bool, | 491 | global: bool, |
| 490 | ) -> Result<()> { | 492 | ) -> Result<()> { |
| 491 | if let Err(error) = silently_save_to_git_config(git_repo, signer_info, global).context(format!( | 493 | let err_msg = format!( |
| 492 | "failed to save login details to {} git config", | 494 | "failed to save login details to {} git config", |
| 493 | if global { "global" } else { "local" } | 495 | if global { "global" } else { "local" } |
| 494 | )) { | 496 | ); |
| 497 | if let Err(error) = | ||
| 498 | silently_save_to_git_config(git_repo, signer_info, global).context(err_msg.clone()) | ||
| 499 | { | ||
| 495 | eprintln!("Error: {:?}", error); | 500 | eprintln!("Error: {:?}", error); |
| 496 | match signer_info { | 501 | match signer_info { |
| 497 | SignerInfo::Nsec { | 502 | SignerInfo::Nsec { |
| @@ -520,6 +525,7 @@ async fn save_to_git_config( | |||
| 520 | match Interactor::default().choice( | 525 | match Interactor::default().choice( |
| 521 | PromptChoiceParms::default() | 526 | PromptChoiceParms::default() |
| 522 | .with_default(0) | 527 | .with_default(0) |
| 528 | .with_prompt(&err_msg) | ||
| 523 | .with_choices(vec![ | 529 | .with_choices(vec![ |
| 524 | "i'll update global git config manually with above values".to_string(), | 530 | "i'll update global git config manually with above values".to_string(), |
| 525 | "only log into local git repository (save to local git config)" | 531 | "only log into local git repository (save to local git config)" |