Third attempt to make a workaround for the Linux specific bug in the fs crate, to make it support backslashess in top_dir path
This commit is contained in:
@@ -189,7 +189,11 @@ pub fn initial_setup_wallet(
|
||||
) -> Result<GlobalWalletConfig, ConfigError> {
|
||||
if create_path {
|
||||
if let Some(p) = data_path.clone() {
|
||||
fs::create_dir_all(p)?;
|
||||
// Fix for a bug in the rust fs package to handle "\" in paths
|
||||
let p_fix = p.clone();
|
||||
let p_fix = p_fix.to_str().unwrap().to_owned().replace("\\", "/");
|
||||
let p_fix = PathBuf::from(p_fix);
|
||||
fs::create_dir_all(p_fix)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ fn real_main() -> i32 {
|
||||
let res = args.value_of("top_level_dir");
|
||||
match res {
|
||||
Some(d) => {
|
||||
let d = d.to_owned().replace("/", "\\");
|
||||
let d = d.to_owned().replace("/", "\\"); // Fix for fs to work with paths on Linux
|
||||
current_dir = Some(PathBuf::from(d));
|
||||
}
|
||||
None => {
|
||||
|
||||
Reference in New Issue
Block a user