Config parsing

This commit is contained in:
Alexey 2025-09-08 17:29:21 +03:00
commit e815e5b439
5 changed files with 89 additions and 8 deletions

14
src/lib.rs Normal file
View file

@ -0,0 +1,14 @@
use config::Config;
use std::path::PathBuf;
pub mod config;
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()
}