From 647a95c1e9ee5ff82df2306249915334c2f00d05 Mon Sep 17 00:00:00 2001 From: Fries Date: Wed, 7 Sep 2022 23:21:59 -0700 Subject: [PATCH] internal::utils: add get_config_dir() --- src/internal/utils.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/internal/utils.rs b/src/internal/utils.rs index 5263758..fc5b132 100644 --- a/src/internal/utils.rs +++ b/src/internal/utils.rs @@ -37,6 +37,14 @@ pub fn log_and_crash(msg: String, exit_code: AppExitCode) -> ! { exit(exit_code as i32); } +pub fn get_config_dir() -> &'static Path { + lazy_static! { + static ref CONFIG_DIR: &'static Path = create_if_not_exist(get_directories().config_dir()); + } + + *CONFIG_DIR +} + pub fn get_cache_dir() -> &'static Path { lazy_static! { static ref CACHE_DIR: &'static Path = create_if_not_exist(get_directories().cache_dir());