Resolve the output filename for a module-map mapping. Priority: filename_override > agent convention > source basename.
(mapping: &ModuleMapping, agent_name: &str)
| 169 | /// |
| 170 | /// Priority: filename_override > agent convention > source basename. |
| 171 | pub fn resolve_module_map_filename(mapping: &ModuleMapping, agent_name: &str) -> String { |
| 172 | if let Some(ref override_name) = mapping.filename_override { |
| 173 | return override_name.clone(); |
| 174 | } |
| 175 | if let Some(convention) = crate::agent_ids::agent_convention_filename(agent_name) { |
| 176 | return convention.to_string(); |
| 177 | } |
| 178 | std::path::Path::new(&mapping.source) |
| 179 | .file_name() |
| 180 | .map(|n| n.to_string_lossy().into_owned()) |
| 181 | .unwrap_or_else(|| mapping.source.clone()) |
| 182 | } |
| 183 | |
| 184 | /// Configuration for managing the `.gitignore` file. |
| 185 | /// Corresponds to the `[gitignore]` section in `agentsync.toml`. |
no test coverage detected