upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/repo_ref.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/repo_ref.rs')
-rw-r--r--src/repo_ref.rs11
1 files changed, 9 insertions, 2 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()