upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sub_commands/init.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-15 17:14:09 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-15 17:18:36 +0100
commit142fee58b0449b3fe3f436986339c318de66b33f (patch)
tree61d4c78e4fed0024d426dd444424b58c36fecf5b /src/sub_commands/init.rs
parentba82a894fad645757c49242c11573b6c5dd8d1e6 (diff)
feat(fetch): fetch events and save to cache
enabler to add simplicity, efficency and offline capability to other functions improve repo announcement selection
Diffstat (limited to 'src/sub_commands/init.rs')
-rw-r--r--src/sub_commands/init.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sub_commands/init.rs b/src/sub_commands/init.rs
index 57785db..db90acd 100644
--- a/src/sub_commands/init.rs
+++ b/src/sub_commands/init.rs
@@ -1,3 +1,5 @@
1use std::collections::HashMap;
2
1use anyhow::{Context, Result}; 3use anyhow::{Context, Result};
2use nostr::{FromBech32, PublicKey, ToBech32}; 4use nostr::{FromBech32, PublicKey, ToBech32};
3 5
@@ -291,7 +293,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
291 println!("publishing repostory reference..."); 293 println!("publishing repostory reference...");
292 294
293 let repo_event = RepoRef { 295 let repo_event = RepoRef {
294 identifier, 296 identifier: identifier.clone(),
295 name, 297 name,
296 description, 298 description,
297 root_commit: earliest_unique_commit, 299 root_commit: earliest_unique_commit,
@@ -299,6 +301,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
299 web, 301 web,
300 relays: relays.clone(), 302 relays: relays.clone(),
301 maintainers: maintainers.clone(), 303 maintainers: maintainers.clone(),
304 events: HashMap::new(),
302 } 305 }
303 .to_event(&signer) 306 .to_event(&signer)
304 .await?; 307 .await?;
@@ -322,7 +325,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
322 } 325 }
323 Err(_) => true, 326 Err(_) => true,
324 } { 327 } {
325 save_repo_config_to_yaml(&git_repo, maintainers.clone(), relays.clone())?; 328 save_repo_config_to_yaml(
329 &git_repo,
330 identifier.clone(),
331 maintainers.clone(),
332 relays.clone(),
333 )?;
326 println!( 334 println!(
327 "maintainers.yaml {}. commit and push.", 335 "maintainers.yaml {}. commit and push.",
328 if repo_config_result.is_err() { 336 if repo_config_result.is_err() {