fix create folder when not existent

This commit is contained in:
DenioD
2019-11-01 15:38:06 +01:00
parent 22b4d56207
commit aeece24f62

View File

@@ -120,8 +120,15 @@ impl LightClientConfig {
c => panic!("Unknown chain {}", c),
};
}
zcash_data_location.into_boxed_path()
// Create directory if it doesn't exist
match std::fs::create_dir_all(zcash_data_location.clone()) {
Ok(_) => zcash_data_location.into_boxed_path(),
Err(e) => {
eprintln!("Couldn't create zcash directory!\n{}", e);
panic!("Couldn't create zcash directory!");
}
}
}
pub fn get_wallet_path(&self) -> Box<Path> {