diff --git a/src/bin/drk.rs b/src/bin/drk.rs index de99a9f7c..2f74b9687 100644 --- a/src/bin/drk.rs +++ b/src/bin/drk.rs @@ -9,7 +9,7 @@ use prettytable::{format, Table}; use serde_json::{json, Value}; use drk::cli::{Config, DrkConfig}; -use drk::util::{join_config_path, NetworkName}; +use drk::util::{join_config_path, NetworkName, path::expand_path}; use drk::{rpc::jsonrpc, rpc::jsonrpc::JsonResult, Error, Result}; struct Drk { @@ -331,7 +331,7 @@ async fn main() -> Result<()> { .get_matches(); let config_path = if args.is_present("CONFIG") { - PathBuf::from(args.value_of("CONFIG").unwrap()) + expand_path(args.value_of("CONFIG").unwrap())? } else { join_config_path(&PathBuf::from("drk.toml"))? }; diff --git a/src/bin/gatewayd.rs b/src/bin/gatewayd.rs index 060ac95f8..a72ad71d9 100644 --- a/src/bin/gatewayd.rs +++ b/src/bin/gatewayd.rs @@ -36,7 +36,7 @@ async fn main() -> Result<()> { .get_matches(); let config_path = if args.is_present("CONFIG") { - PathBuf::from(args.value_of("CONFIG").unwrap()) + expand_path(args.value_of("CONFIG").unwrap())? } else { join_config_path(&PathBuf::from("gatewayd.toml"))? };