Finish fn lconf(). Project-specific vals load
Loop over the keys (ignore the "all" one) and repeat the same property extraction process.
This commit is contained in:
@@ -63,6 +63,25 @@ fn lconf(text: &str) -> Result<WholeFile> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Loop over the per-project configs, if any.
|
||||||
|
let per_project_keys = cfg_table
|
||||||
|
.keys()
|
||||||
|
.filter(|s| { // Discard the "[all]" table
|
||||||
|
*s != "all"
|
||||||
|
});
|
||||||
|
|
||||||
|
for path in per_project_keys {
|
||||||
|
let tab = get_table(cfg_table, path)?;
|
||||||
|
let part_cfg = PartialConfig {
|
||||||
|
project_path: Some(path.clone()),
|
||||||
|
gitea_url: get_maybe_property(&tab, "gitea_url")?.cloned(),
|
||||||
|
owner: get_maybe_property(&tab, "owner")?.cloned(),
|
||||||
|
repo: get_maybe_property(&tab, "repo")?.cloned(),
|
||||||
|
token: get_maybe_property(&tab, "token")?.cloned(),
|
||||||
|
};
|
||||||
|
whole.project_overrides.push(part_cfg);
|
||||||
|
}
|
||||||
|
println!(" ->> lconf - keys {:?}", cfg_table.keys().collect::<Vec<&String>>());
|
||||||
Ok(whole)
|
Ok(whole)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user