don't panic if create_dir_all fails

pull/279/head
FabianLars 2 years ago
parent 03952644e7
commit b3e579656d
No known key found for this signature in database
GPG Key ID: 3B12BC1DEBF61125

@ -92,7 +92,7 @@ fn path_mapper<R: Runtime>(
.replace("?mode=ro", ""); .replace("?mode=ro", "");
let path = Path::new(&path); let path = Path::new(&path);
create_dir_all(path.parent().unwrap_or(path))?; let _ = create_dir_all(path.parent().unwrap_or(path)); // FIXME: Log this instead of ignoring it
return Ok(connection_string.replace(r"\\?\", "/").replace('\\', "/")); return Ok(connection_string.replace(r"\\?\", "/").replace('\\', "/"));
} }
@ -103,17 +103,18 @@ fn path_mapper<R: Runtime>(
.replace("sqlite://", "") .replace("sqlite://", "")
.replace("sqlite:", "") .replace("sqlite:", "")
.replace("?mode=ro", ""); .replace("?mode=ro", "");
let path = Path::new(&path);
let path = resolve_path( let path = resolve_path(
&app.config(), &app.config(),
app.package_info(), app.package_info(),
&app.env(), &app.env(),
path.parent().unwrap_or(path), path,
#[allow(deprecated)] // FIXME: Use non deprecated variant in tauri v2 #[allow(deprecated)] // FIXME: Use non deprecated variant in tauri v2
dir.or(Some(BaseDirectory::App)), dir.or(Some(BaseDirectory::App)),
)?; )?;
let _ = create_dir_all(path.parent().unwrap_or(path)); // FIXME: Log this instead of ignoring it
Ok(format!( Ok(format!(
"sqlite://{}{}", "sqlite://{}{}",
path.display().to_string().replace(r"\\?\", "/"), path.display().to_string().replace(r"\\?\", "/"),

Loading…
Cancel
Save