Config parsing
This commit is contained in:
parent
8d5d3584b1
commit
e815e5b439
5 changed files with 89 additions and 8 deletions
14
src/lib.rs
Normal file
14
src/lib.rs
Normal 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()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue