15 lines
374 B
Rust
15 lines
374 B
Rust
use config::Config;
|
|
use std::path::PathBuf;
|
|
|
|
pub mod config;
|
|
pub mod log;
|
|
|
|
pub fn load_config() -> Config {
|
|
if let Ok(path_str) = std::env::var("XDG_CONFIG_HOME") {
|
|
let mut path = PathBuf::from(path_str);
|
|
path.push("aliveline");
|
|
path.push("config.toml");
|
|
return Config::load(path);
|
|
}
|
|
Config::new(PathBuf::from("./config.toml"))
|
|
}
|