mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 15:21:39 +02:00
Second attempt to fix double path generation bug present in the original grin-wallet code, probably by an inherent bug in fs::create_dir_all
This commit is contained in:
@@ -114,13 +114,6 @@ where
|
|||||||
let mut config_file_name = PathBuf::from(self.data_dir.clone());
|
let mut config_file_name = PathBuf::from(self.data_dir.clone());
|
||||||
config_file_name.push(file_name);
|
config_file_name.push(file_name);
|
||||||
|
|
||||||
// create top level dir if it doesn't exist
|
|
||||||
let dd = PathBuf::from(self.data_dir.clone());
|
|
||||||
if !dd.exists() {
|
|
||||||
// try create
|
|
||||||
fs::create_dir_all(dd)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut data_dir_name = PathBuf::from(self.data_dir.clone());
|
let mut data_dir_name = PathBuf::from(self.data_dir.clone());
|
||||||
data_dir_name.push(GRIN_WALLET_DIR);
|
data_dir_name.push(GRIN_WALLET_DIR);
|
||||||
|
|
||||||
@@ -145,7 +138,13 @@ where
|
|||||||
|
|
||||||
// if no config provided, update defaults
|
// if no config provided, update defaults
|
||||||
if update == true {
|
if update == true {
|
||||||
default_config.update_paths(&abs_path_node, &absolute_path_wallet);
|
// create top level dir if it doesn't exist
|
||||||
|
let dd = PathBuf::from(self.data_dir.clone());
|
||||||
|
if !dd.exists() {
|
||||||
|
// try create
|
||||||
|
fs::create_dir_all(dd)?;
|
||||||
|
default_config.update_paths(&abs_path_node, &absolute_path_wallet);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
let res =
|
let res =
|
||||||
default_config.write_to_file(config_file_name.to_str().unwrap(), false, None, None);
|
default_config.write_to_file(config_file_name.to_str().unwrap(), false, None, None);
|
||||||
|
|||||||
Reference in New Issue
Block a user