From 617b5cba43e06fab4bb43a8d147252528a917039 Mon Sep 17 00:00:00 2001 From: Noor Date: Tue, 15 Jul 2025 19:31:51 +0530 Subject: [PATCH] custom CLI directory for detee-api specify a custom path for the CLI directory using the `DETEE_API_USER_PATH` environment variable. --- src/config.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 5c55c86..6efff5c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -187,7 +187,9 @@ impl Config { } pub fn cli_dir_path() -> Result { - let dir = Self::home_dir() + ("/.detee/cli"); + let dir = std::env::var("DETEE_API_USER_PATH") + .unwrap_or_else(|_| Self::home_dir() + ("/.detee/cli")); + if !Path::new(&dir).exists() { warn!("Could not config dir. Creating {dir}"); std::fs::create_dir_all(dir.clone())?;