Skip to content
Snippets Groups Projects

fix 'could not create data dir' on windows

Merged d0p1 requested to merge d0p1/gcli-v2s:master into master
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
  • b5bfd1b9
    fix 'could not create data dir' on windows · b5bfd1b9
    d0p1 authored
    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.
+ 1
1
@@ -63,7 +63,7 @@ impl Default for Data {
fn default() -> Self {
let project_dir = directories::ProjectDirs::from("org", "duniter", "gcli").unwrap();
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 {
project_dir,
Loading