upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/repo_ref.rs11
-rw-r--r--tests/list.rs4
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::{
6}; 6};
7 7
8use anyhow::{bail, Context, Result}; 8use anyhow::{bail, Context, Result};
9use console::Style;
9use nostr::{nips::nip01::Coordinate, FromBech32, PublicKey, Tag, TagStandard, ToBech32}; 10use nostr::{nips::nip01::Coordinate, FromBech32, PublicKey, Tag, TagStandard, ToBech32};
10use nostr_sdk::{Kind, NostrSigner, Timestamp}; 11use nostr_sdk::{Kind, NostrSigner, Timestamp};
11use serde::{Deserialize, Serialize}; 12use serde::{Deserialize, Serialize};
@@ -273,7 +274,7 @@ pub async fn try_and_get_repo_coordinates(
273 if let Ok(maintainer) = PublicKey::parse(m) { 274 if let Ok(maintainer) = PublicKey::parse(m) {
274 if current_user.eq(&maintainer) { 275 if current_user.eq(&maintainer) {
275 println!( 276 println!(
276 "please run `nigt init` to add the repo identifier to maintainers.yaml" 277 "please run `ngit init` to add the repo identifier to maintainers.yaml"
277 ); 278 );
278 } 279 }
279 } 280 }
@@ -294,7 +295,7 @@ pub async fn try_and_get_repo_coordinates(
294 } 295 }
295 if events.is_empty() { 296 if events.is_empty() {
296 println!( 297 println!(
297 "finding repository events for this repository for npubs in maintains.yaml" 298 "finding repository events for this repository for npubs in maintainers.yaml"
298 ); 299 );
299 events = client 300 events = client
300 .get_events(client.get_fallback_relays().clone(), vec![filter.clone()]) 301 .get_events(client.get_fallback_relays().clone(), vec![filter.clone()])
@@ -339,6 +340,12 @@ pub async fn try_and_get_repo_coordinates(
339} 340}
340 341
341fn ask_for_naddr() -> Result<Coordinate> { 342fn ask_for_naddr() -> Result<Coordinate> {
343 let dim = Style::new().color256(247);
344 println!(
345 "{}",
346 dim.apply_to("hint: https://gitworkshop.dev/repos lists repositories and their naddr"),
347 );
348
342 Ok(loop { 349 Ok(loop {
343 if let Ok(c) = Coordinate::parse( 350 if let Ok(c) = Coordinate::parse(
344 Interactor::default() 351 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 {
157 let test_repo = GitTestRepo::without_repo_in_git_config(); 157 let test_repo = GitTestRepo::without_repo_in_git_config();
158 test_repo.populate()?; 158 test_repo.populate()?;
159 let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]); 159 let mut p = CliTester::new_from_dir(&test_repo.dir, ["list"]);
160 160 p.expect(
161 "hint: https://gitworkshop.dev/repos lists repositories and their naddr\r\n",
162 )?;
161 if invalid_input { 163 if invalid_input {
162 let mut input = p.expect_input("repository naddr")?; 164 let mut input = p.expect_input("repository naddr")?;
163 input.succeeds_with("dfgvfvfzadvd")?; 165 input.succeeds_with("dfgvfvfzadvd")?;