upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/ngit
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ngit')
-rw-r--r--src/bin/ngit/sub_commands/init.rs21
-rw-r--r--src/bin/ngit/sub_commands/send.rs8
2 files changed, 20 insertions, 9 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs
index 4aa7ced..3731e3a 100644
--- a/src/bin/ngit/sub_commands/init.rs
+++ b/src/bin/ngit/sub_commands/init.rs
@@ -11,6 +11,7 @@ use nostr::{
11 nips::{ 11 nips::{
12 nip01::Coordinate, 12 nip01::Coordinate,
13 nip05::{self}, 13 nip05::{self},
14 nip19::Nip19Coordinate,
14 }, 15 },
15}; 16};
16use nostr_sdk::{Kind, RelayUrl}; 17use nostr_sdk::{Kind, RelayUrl};
@@ -437,10 +438,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
437 // TODO - does this git config item do more harm than good? 438 // TODO - does this git config item do more harm than good?
438 git_repo.save_git_config_item( 439 git_repo.save_git_config_item(
439 "nostr.repo", 440 "nostr.repo",
440 &Coordinate { 441 &Nip19Coordinate {
441 kind: Kind::GitRepoAnnouncement, 442 coordinate: Coordinate {
442 public_key: user_ref.public_key, 443 kind: Kind::GitRepoAnnouncement,
443 identifier: identifier.clone(), 444 public_key: user_ref.public_key,
445 identifier: identifier.clone(),
446 },
444 relays: vec![], 447 relays: vec![],
445 } 448 }
446 .to_bech32()?, 449 .to_bech32()?,
@@ -471,10 +474,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
471 repo_ref.set_nostr_git_url(NostrUrlDecoded { 474 repo_ref.set_nostr_git_url(NostrUrlDecoded {
472 original_string: String::new(), 475 original_string: String::new(),
473 nip05: Some(nip05.clone()), 476 nip05: Some(nip05.clone()),
474 coordinate: Coordinate { 477 coordinate: Nip19Coordinate {
475 kind: Kind::GitRepoAnnouncement, 478 coordinate: Coordinate {
476 public_key: user_ref.public_key, 479 kind: Kind::GitRepoAnnouncement,
477 identifier: repo_ref.identifier.clone(), 480 public_key: user_ref.public_key,
481 identifier: repo_ref.identifier.clone(),
482 },
478 relays: if inter.next().is_some() || relays.is_empty() { 483 relays: if inter.next().is_some() || relays.is_empty() {
479 vec![] 484 vec![]
480 } else { 485 } else {
diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs
index 7c898bc..9fc00d9 100644
--- a/src/bin/ngit/sub_commands/send.rs
+++ b/src/bin/ngit/sub_commands/send.rs
@@ -238,7 +238,13 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re
238 if root_proposal_id.is_none() { 238 if root_proposal_id.is_none() {
239 if let Some(event) = events.first() { 239 if let Some(event) = events.first() {
240 let event_bech32 = if let Some(relay) = repo_ref.relays.first() { 240 let event_bech32 = if let Some(relay) = repo_ref.relays.first() {
241 Nip19Event::new(event.id, vec![relay.to_string()]).to_bech32()? 241 Nip19Event {
242 event_id: event.id,
243 relays: vec![relay.clone()],
244 author: None,
245 kind: None,
246 }
247 .to_bech32()?
242 } else { 248 } else {
243 event.id.to_bech32()? 249 event.id.to_bech32()?
244 }; 250 };