expand the paths when use config flag with drk and gatewayd

This commit is contained in:
ghassmo
2021-10-27 01:10:00 +03:00
parent b29d88651f
commit 817ef2d3b2
2 changed files with 3 additions and 3 deletions

View File

@@ -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"))?
};

View File

@@ -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"))?
};