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

fix 'could not create data dir' on windows (!29)

* 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
No related branches found
No related tags found
1 merge request!29fix 'could not create data dir' on windows
...@@ -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.
Finish editing this message first!
Please register or to comment