path update

This commit is contained in:
zastian-dev
2026-02-09 19:58:57 +00:00
parent 79625743bd
commit 4cb6ad7547

View File

@@ -6,7 +6,11 @@ use std::path::PathBuf;
lazy_static! { lazy_static! {
/// Base data directory for the application, using XDG standards. /// Base data directory for the application, using XDG standards.
pub static ref DATA_DIR: PathBuf = { pub static ref DATA_DIR: PathBuf = {
let mut path = dirs::data_dir().unwrap_or_else(|| PathBuf::from(".")); let mut path = std::env::var("VIBE_INVEST_DATA_DIR")
.map(PathBuf::from)
.unwrap_or_else(|_| {
dirs::data_dir().unwrap_or_else(|| PathBuf::from("."))
});
path.push("invest-bot"); path.push("invest-bot");
std::fs::create_dir_all(&path).expect("Failed to create data directory"); std::fs::create_dir_all(&path).expect("Failed to create data directory");
path path