From 142fee58b0449b3fe3f436986339c318de66b33f Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 15 Jul 2024 17:14:09 +0100 Subject: feat(fetch): fetch events and save to cache enabler to add simplicity, efficency and offline capability to other functions improve repo announcement selection --- src/sub_commands/init.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/sub_commands/init.rs') 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 @@ +use std::collections::HashMap; + use anyhow::{Context, Result}; use nostr::{FromBech32, PublicKey, ToBech32}; @@ -291,7 +293,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { println!("publishing repostory reference..."); let repo_event = RepoRef { - identifier, + identifier: identifier.clone(), name, description, root_commit: earliest_unique_commit, @@ -299,6 +301,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { web, relays: relays.clone(), maintainers: maintainers.clone(), + events: HashMap::new(), } .to_event(&signer) .await?; @@ -322,7 +325,12 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { } Err(_) => true, } { - save_repo_config_to_yaml(&git_repo, maintainers.clone(), relays.clone())?; + save_repo_config_to_yaml( + &git_repo, + identifier.clone(), + maintainers.clone(), + relays.clone(), + )?; println!( "maintainers.yaml {}. commit and push.", if repo_config_result.is_err() { -- cgit v1.2.3