1/* This Source Code Form is subject to the terms of the Mozilla Public
2* License, v. 2.0. If a copy of the MPL was not distributed with this
3* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
45use std::collections::HashMap;
67use crate::util::loaders::LoaderConfig;
89#[derive(Debug, Default)]
10pub struct FmlLoaderConfig {
11pub cache: Option<String>,
12pub refs: HashMap<String, String>,
13pub ref_files: Vec<String>,
14}
1516impl From<FmlLoaderConfig> for LoaderConfig {
17fn from(value: FmlLoaderConfig) -> Self {
18let cwd = std::env::current_dir().expect("Current Working Directory is not set");
19let cache = value.cache.map(|v| cwd.join(v));
20Self {
21 cwd,
22 refs: value.refs.into_iter().collect(),
23 repo_files: value.ref_files,
24 cache_dir: cache,
25 }
26 }
27}