configurable data_dir
This commit is contained in:
parent
6fc08f3fdd
commit
e69ae1a21a
@ -15,6 +15,7 @@ pub struct Config {
|
||||
pub network: Network,
|
||||
pub electrum_url: String,
|
||||
pub zmq_url: String,
|
||||
pub data_dir: String,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
@ -70,6 +71,10 @@ impl Config {
|
||||
.remove("zmq_url")
|
||||
.ok_or(Error::msg("No \"zmq_url\""))?
|
||||
.to_owned(),
|
||||
data_dir: file_content
|
||||
.remove("data_dir")
|
||||
.ok_or(Error::msg("No \"data_dir\""))?
|
||||
.to_owned(),
|
||||
};
|
||||
|
||||
Ok(config)
|
||||
|
@ -346,7 +346,7 @@ async fn main() -> Result<()> {
|
||||
.try_into()?;
|
||||
|
||||
let mut app_dir = PathBuf::from_str(&env::var("HOME")?)?;
|
||||
app_dir.push(".4nk");
|
||||
app_dir.push(config.data_dir);
|
||||
let mut wallet_file = app_dir.clone();
|
||||
wallet_file.push(&config.wallet_name);
|
||||
let mut processes_file = app_dir.clone();
|
||||
|
Loading…
x
Reference in New Issue
Block a user