diff options
author | Akshay <[email protected]> | 2020-07-10 18:16:53 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-07-10 18:16:53 +0100 |
commit | b414a7ce0732b70560f259bf88e4cdce4c555590 (patch) | |
tree | aa857d1b5b927a34dc4279a59d276cf70c675c2e | |
parent | 27a925262bfd4a70f251226c17b43749b9fd81bb (diff) |
i dun an oopsie
-rw-r--r-- | src/utils.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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 @@ | |||
1 | use cursive::theme::{BaseColor, Color}; | 1 | use cursive::theme::{BaseColor, Color}; |
2 | use directories::ProjectDirs; | 2 | use directories::ProjectDirs; |
3 | use std::fs; | ||
3 | use std::path::{Path, PathBuf}; | 4 | use std::path::{Path, PathBuf}; |
4 | 5 | ||
5 | pub struct AppConfig { | 6 | pub struct AppConfig { |
@@ -36,6 +37,7 @@ pub fn load_configuration_file() -> AppConfig { | |||
36 | pub fn data_file() -> PathBuf { | 37 | pub fn data_file() -> PathBuf { |
37 | if let Some(proj_dirs) = ProjectDirs::from("rs", "nerdypepper", "dijo") { | 38 | if let Some(proj_dirs) = ProjectDirs::from("rs", "nerdypepper", "dijo") { |
38 | let mut data_file = PathBuf::from(proj_dirs.data_dir()); | 39 | let mut data_file = PathBuf::from(proj_dirs.data_dir()); |
40 | fs::create_dir_all(&data_file); | ||
39 | data_file.push("habit_record.json"); | 41 | data_file.push("habit_record.json"); |
40 | return data_file; | 42 | return data_file; |
41 | } else { | 43 | } else { |