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)
| 717 | /// The returned [`SharedConfig`] is intended to be passed to [`TskConfig::resolve_config`] |
| 718 | /// as the project config layer. |
| 719 | pub 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 | /// |
no outgoing calls