custom CLI directory for detee-api
specify a custom path for the CLI directory using the `DETEE_API_USER_PATH` environment variable.
This commit is contained in:
parent
006817161d
commit
617b5cba43
@ -187,7 +187,9 @@ impl Config {
|
||||
}
|
||||
|
||||
pub fn cli_dir_path() -> Result<String, Error> {
|
||||
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())?;
|
||||
|
Loading…
Reference in New Issue
Block a user