Skip to content

Commit 397fb74

Browse files
committed
Add config_dir to constants
1 parent 7c54b35 commit 397fb74

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/constants.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ pub static CACHE_DIR: LazyLock<String> = LazyLock::new(|| {
1717
let cache_dir = HOME_DIR.clone() + "/.cache/lumin/";
1818

1919
if !std::fs::exists(&cache_dir).expect("Can check if cache_dir exists") {
20-
log::info!("Data dir not found. Creating at path {cache_dir:?}");
20+
log::info!("cache_dir not found. Creating at path {cache_dir:?}");
2121
std::fs::create_dir_all(&cache_dir).expect("Could create cache_dir");
2222
}
2323
cache_dir
2424
});
25+
26+
pub static CONFIG_DIR: LazyLock<String> = LazyLock::new(|| {
27+
let config_dir = HOME_DIR.clone() + "/.config/lumin/";
28+
29+
if !std::fs::exists(&config_dir).expect("Can check if config_dir exists") {
30+
log::info!("Config dir not found. Creating at path {config_dir:?}");
31+
std::fs::create_dir_all(&config_dir).expect("Could create config_dir");
32+
}
33+
config_dir
34+
});

0 commit comments

Comments
 (0)