Skip to content
Snippets Groups Projects
Commit b5bfd1b9 authored by d0p1's avatar d0p1 Committed by poka
Browse files

fix 'could not create data dir' on windows

from rust doc:

If a parent of the given path doesn't exist, this function will return an error. To create a directory and all its missing parents at the same time, use the create_dir_all function.
parent 8c4a2cf8
Branches
Tags crypto/v0.3.0-b1
1 merge request!29fix 'could not create data dir' on windows
This commit is part of merge request !29. Comments created here will be created in the context of that merge request.
...@@ -63,7 +63,7 @@ impl Default for Data { ...@@ -63,7 +63,7 @@ impl Default for Data {
fn default() -> Self { fn default() -> Self {
let project_dir = directories::ProjectDirs::from("org", "duniter", "gcli").unwrap(); let project_dir = directories::ProjectDirs::from("org", "duniter", "gcli").unwrap();
if !project_dir.data_dir().exists() { if !project_dir.data_dir().exists() {
std::fs::create_dir(project_dir.data_dir()).expect("could not create data dir"); std::fs::create_dir_all(project_dir.data_dir()).expect("could not create data dir");
}; };
Self { Self {
project_dir, project_dir,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment