MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / load_project_config

Function load_project_config

src/context/tsk_config.rs:719–735  ·  view source on GitHub ↗

Load project-level configuration from `.tsk/tsk.toml` in the project root. Returns `None` if the file doesn't exist or can't be parsed (fail-open with warning). The returned [`SharedConfig`] is intended to be passed to [`TskConfig::resolve_config`] as the project config layer.

(project_root: &Path)

Source from the content-addressed store, hash-verified

717/// The returned [`SharedConfig`] is intended to be passed to [`TskConfig::resolve_config`]
718/// as the project config layer.
719pub fn load_project_config(project_root: &Path) -> Option<SharedConfig> {
720 let config_file = project_root.join(".tsk").join("tsk.toml");
721 if config_file.exists() {
722 match std::fs::read_to_string(&config_file) {
723 Ok(content) => match toml::from_str(&content) {
724 Ok(config) => return Some(config),
725 Err(e) => {
726 eprintln!("Warning: Failed to parse {}: {}", config_file.display(), e);
727 }
728 },
729 Err(e) => {
730 eprintln!("Warning: Failed to read {}: {}", config_file.display(), e);
731 }
732 }
733 }
734 None
735}
736
737/// Resolves the stack using the full resolution chain.
738///

Callers 3

buildMethod · 0.85
test_load_project_configFunction · 0.85
resolve_config_from_taskFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_load_project_configFunction · 0.68