mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Ensure config directory exists. (#1802)
Ensure the config directory exists before trying to write the public key file. It is the responsibility of obtain_private_key to do so, as per the purpose of this function.
This commit is contained in:
committed by
Bastian Köcher
parent
2acab71254
commit
cf71350186
@@ -42,6 +42,7 @@ pub fn obtain_private_key(
|
||||
.map_err(|err| IoError::new(IoErrorKind::InvalidData, err))
|
||||
} else {
|
||||
if let Some(ref path) = net_config_path {
|
||||
fs::create_dir_all(Path::new(path))?;
|
||||
// Try fetch the key from a the file containing the secret.
|
||||
let secret_path = Path::new(path).join(SECRET_FILE);
|
||||
match load_private_key_from_file(&secret_path) {
|
||||
|
||||
Reference in New Issue
Block a user