custom CLI directory for detee-api #10

Merged
ghe0 merged 1 commits from detee-api into main 2025-07-16 15:01:20 +00:00
2 changed files with 5 additions and 2 deletions

@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
use crate::constants::{BRAIN_STAGING, BRAIN_TESTING};
use crate::constants::{BRAIN_STAGING, BRAIN_TESTING, CONFIG_OVERRIDE_PATH_ENV};
use crate::general;
use crate::utils::block_on;
use ed25519_dalek::SigningKey;
@ -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(CONFIG_OVERRIDE_PATH_ENV)
.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())?;

@ -5,6 +5,7 @@ use std::sync::LazyLock;
pub const HRATLS_APP_PORT: u32 = 34500;
pub const MAX_REDIRECTS: u16 = 3;
pub const CONFIG_OVERRIDE_PATH_ENV: &str = "DETEE_API_USER_PATH";
pub const STAGING_BRAIN_URLS: [&str; 3] = [
"https://156.146.63.216:31337", // staging brain 1