refactor: Store the config in CliOptions instead of its path
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
@@ -21,7 +21,6 @@ use nostr::event::{EventBuilder, Tag};
|
||||
|
||||
use crate::{
|
||||
cli::{
|
||||
CliConfig,
|
||||
CliOptions,
|
||||
CommandRunner,
|
||||
types::{NaddrOrSet, OptionNaddrOrSetVecExt, RelayOrSetVecExt},
|
||||
@@ -97,12 +96,11 @@ impl NewArgs {
|
||||
|
||||
impl CommandRunner for NewArgs {
|
||||
async fn run(self, options: CliOptions) -> N34Result<()> {
|
||||
let config = CliConfig::load_toml(&options.config_path)?;
|
||||
let naddrs = utils::naddrs_or_file(
|
||||
self.naddrs.flat_naddrs(&config.sets)?,
|
||||
self.naddrs.flat_naddrs(&options.config.sets)?,
|
||||
&utils::nostr_address_path()?,
|
||||
)?;
|
||||
let relays = options.relays.clone().flat_relays(&config.sets)?;
|
||||
let relays = options.relays.clone().flat_relays(&options.config.sets)?;
|
||||
let client = NostrClient::init(&options, &relays).await;
|
||||
let user_pubk = options.pubkey().await?;
|
||||
let mut naddrs_iter = naddrs.clone().into_iter();
|
||||
|
||||
Reference in New Issue
Block a user