diff --git a/src/paths.rs b/src/paths.rs index a94a225..6479875 100644 --- a/src/paths.rs +++ b/src/paths.rs @@ -6,7 +6,11 @@ use std::path::PathBuf; lazy_static! { /// Base data directory for the application, using XDG standards. 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"); std::fs::create_dir_all(&path).expect("Failed to create data directory"); path