From 07014e0552d42a2dc1c8d99757f5f03a421dda3f Mon Sep 17 00:00:00 2001 From: Mirko von Leipzig Date: Fri, 2 Jul 2021 14:49:41 +0200 Subject: [PATCH] feat: simplified zebra config path --- src/setup/node.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/setup/node.rs b/src/setup/node.rs index 43ad5ad1..b0896242 100644 --- a/src/setup/node.rs +++ b/src/setup/node.rs @@ -76,17 +76,12 @@ impl Node { // insert the config file cmd args match node.meta.kind { NodeKind::Zebra => { - // Bit more convoluted since we need to insert the args before `start`, which comes last. - let start_arg = node - .meta - .start_args - .pop() - .expect("Expected at least one arg for Zebra (`start`)"); - node.meta.start_args.push("--config".into()); + let n = node.meta.start_args.len(); + assert!(n > 1, "Expected at least one arg for Zebra (`start`)"); + node.meta.start_args.insert(n - 1, "--config".into()); node.meta .start_args - .push(node.config_filepath().into_os_string()); - node.meta.start_args.push(start_arg); + .insert(n, node.config_filepath().into_os_string()); } NodeKind::Zcashd => { node.meta @@ -308,8 +303,8 @@ impl Node { fn config_filepath(&self) -> std::path::PathBuf { match self.meta.kind { - NodeKind::Zebra => self.meta.path.join(ZEBRA_CONFIG), - NodeKind::Zcashd => self.meta.path.join(ZCASHD_CONFIG), + NodeKind::Zebra => std::env::current_dir().unwrap().join(ZEBRA_CONFIG), + NodeKind::Zcashd => std::env::current_dir().unwrap().join(ZCASHD_CONFIG), } }