mlem/src/config.rs

17 lines
429 B
Rust
Raw Normal View History

2024-04-01 19:05:53 +02:00
use serde::Deserialize;
use std::fs::read_to_string;
#[derive(Deserialize)]
pub struct Config {
pub output_dir: String,
pub src_dir: String,
pub templates_dir: String,
2024-04-02 21:48:02 +02:00
pub emoji_web_directory: String,
pub emoji_local_directory: String,
2024-04-01 19:05:53 +02:00
}
pub fn read_config() -> Config {
let config_string = read_to_string("mlem.toml").expect("mlem.toml config not found");
toml::from_str(&config_string).unwrap()
}