15 lines
353 B
Rust
15 lines
353 B
Rust
|
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,
|
||
|
}
|
||
|
|
||
|
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()
|
||
|
}
|