Fix for top dir with backlashes to work on Linux and to properly format the path in the seed generation message

This commit is contained in:
Anynomouss
2025-04-08 11:04:12 +02:00
parent cd2f64c234
commit 39f00fe8b7
3 changed files with 27 additions and 11 deletions
+9 -1
View File
@@ -166,8 +166,16 @@ impl WalletSeed {
// create directory if it doesn't exist
fs::create_dir_all(data_file_dir).map_err(|_| Error::IO)?;
let seed_file_path = &format!("{}{}{}", data_file_dir, MAIN_SEPARATOR, SEED_FILE,);
// Format data path properly
let data_file_dir_formatted = data_file_dir;
let data_file_dir_formatted =
data_file_dir_formatted.replace("/", &MAIN_SEPARATOR.to_string());
let data_file_dir_formatted =
data_file_dir_formatted.replace("\\", &MAIN_SEPARATOR.to_string());
let seed_file_path =
&format!("{}{}{}", data_file_dir_formatted, MAIN_SEPARATOR, SEED_FILE,);
// Inform the user the seed has been generated
warn!("Generating wallet seed file at: {}", seed_file_path);
let exists = WalletSeed::seed_file_exists(data_file_dir)?;
if exists && !test_mode {