From b414a7ce0732b70560f259bf88e4cdce4c555590 Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 10 Jul 2020 22:46:53 +0530 Subject: i dun an oopsie --- src/utils.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index ab7e7ef..d23f70d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,5 +1,6 @@ use cursive::theme::{BaseColor, Color}; use directories::ProjectDirs; +use std::fs; use std::path::{Path, PathBuf}; pub struct AppConfig { @@ -36,6 +37,7 @@ pub fn load_configuration_file() -> AppConfig { pub fn data_file() -> PathBuf { if let Some(proj_dirs) = ProjectDirs::from("rs", "nerdypepper", "dijo") { let mut data_file = PathBuf::from(proj_dirs.data_dir()); + fs::create_dir_all(&data_file); data_file.push("habit_record.json"); return data_file; } else { -- cgit v1.2.3