From 643fa17fde858c2d6f934dcc435eb84843cc172e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 22 Jul 2024 15:43:46 +0100 Subject: fix: typos and improve copy when finding repo announcements add a hint to find naddr on gitworkshop.dev --- src/repo_ref.rs | 11 +++++++++-- tests/list.rs | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/repo_ref.rs b/src/repo_ref.rs index a1ef11a..0409502 100644 --- a/src/repo_ref.rs +++ b/src/repo_ref.rs @@ -6,6 +6,7 @@ use std::{ }; use anyhow::{bail, Context, Result}; +use console::Style; use nostr::{nips::nip01::Coordinate, FromBech32, PublicKey, Tag, TagStandard, ToBech32}; use nostr_sdk::{Kind, NostrSigner, Timestamp}; use serde::{Deserialize, Serialize}; @@ -273,7 +274,7 @@ pub async fn try_and_get_repo_coordinates( if let Ok(maintainer) = PublicKey::parse(m) { if current_user.eq(&maintainer) { println!( - "please run `nigt init` to add the repo identifier to maintainers.yaml" + "please run `ngit init` to add the repo identifier to maintainers.yaml" ); } } @@ -294,7 +295,7 @@ pub async fn try_and_get_repo_coordinates( } if events.is_empty() { println!( - "finding repository events for this repository for npubs in maintains.yaml" + "finding repository events for this repository for npubs in maintainers.yaml" ); events = client .get_events(client.get_fallback_relays().clone(), vec![filter.clone()]) @@ -339,6 +340,12 @@ pub async fn try_and_get_repo_coordinates( } fn ask_for_naddr() -> Result { + let dim = Style::new().color256(247); + println!( + "{}", + dim.apply_to("hint: https://gitworkshop.dev/repos lists repositories and their naddr"), + ); + Ok(loop { if let Ok(c) = Coordinate::parse( Interactor::default() diff --git a/tests/list.rs b/tests/list.rs index 0005053..22d82fd 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -157,7 +157,9 @@ mod cannot_find_repo_event { let test_repo = GitTestRepo::without_repo_in_git_config(); test_repo.populate()?; let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); - + p.expect( + "hint: https://gitworkshop.dev/repos lists repositories and their naddr\r\n", + )?; if invalid_input { let mut input = p.expect_input("repository naddr")?; input.succeeds_with("dfgvfvfzadvd")?; -- cgit v1.2.3