2025-10-01 21:30:43 -07:00
|
|
|
use crate::utils;
|
2025-10-01 18:25:49 -07:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize, Default)]
|
|
|
|
|
pub struct RootConfiguration {
|
|
|
|
|
#[serde(default)]
|
|
|
|
|
pub modules: Vec<ModuleConfiguration>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize, Default)]
|
|
|
|
|
pub struct ModuleConfiguration {
|
|
|
|
|
#[serde(default)]
|
|
|
|
|
pub chainloader: Option<ChainloaderConfiguration>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize, Default)]
|
|
|
|
|
pub struct ChainloaderConfiguration {
|
|
|
|
|
pub path: String,
|
2025-10-02 00:24:19 -07:00
|
|
|
#[serde(default)]
|
|
|
|
|
pub options: Vec<String>,
|
2025-10-01 18:25:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load() -> RootConfiguration {
|
2025-10-01 21:30:43 -07:00
|
|
|
let content = utils::read_file_contents("sprout.toml");
|
2025-10-01 18:25:49 -07:00
|
|
|
toml::from_slice(&content).expect("unable to parse sprout.toml file")
|
|
|
|
|
}
|