nimbus_fml/client/
config.rs1use std::collections::HashMap;
6
7use crate::util::loaders::LoaderConfig;
8
9#[derive(Debug, Default)]
10pub struct FmlLoaderConfig {
11 pub cache: Option<String>,
12 pub refs: HashMap<String, String>,
13 pub ref_files: Vec<String>,
14}
15
16impl From<FmlLoaderConfig> for LoaderConfig {
17 fn from(value: FmlLoaderConfig) -> Self {
18 let cwd = std::env::current_dir().expect("Current Working Directory is not set");
19 let cache = value.cache.map(|v| cwd.join(v));
20 Self {
21 cwd,
22 refs: value.refs.into_iter().collect(),
23 repo_files: value.ref_files,
24 cache_dir: cache,
25 }
26 }
27}