MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / load_config_in_dir

Function load_config_in_dir

load_config/src/lib.rs:35–44  ·  view source on GitHub ↗
(name: &str, path: &str, nested: bool, mut figment: Figment)

Source from the content-addressed store, hash-verified

33}
34
35fn load_config_in_dir(name: &str, path: &str, nested: bool, mut figment: Figment) -> Figment {
36 for ext in ["toml", "json"] {
37 let filename = format!("{}/{}.{}", path, name, ext);
38 if std::path::Path::new(&filename).exists() {
39 info!("Loading config file: {}", filename);
40 figment = load_config_file(&filename, nested, figment);
41 }
42 }
43 figment
44}
45
46fn search_load_config(
47 name: &str,

Callers 2

search_load_configFunction · 0.85
test_load_config_in_dirFunction · 0.85

Calls 1

load_config_fileFunction · 0.85

Tested by 1

test_load_config_in_dirFunction · 0.68