MCPcopy Create free account
hub / github.com/dallay/agentsync / resolve_module_map_filename

Function resolve_module_map_filename

src/config.rs:171–182  ·  view source on GitHub ↗

Resolve the output filename for a module-map mapping. Priority: filename_override > agent convention > source basename.

(mapping: &ModuleMapping, agent_name: &str)

Source from the content-addressed store, hash-verified

169///
170/// Priority: filename_override > agent convention > source basename.
171pub 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`.

Callers 5

all_gitignore_entriesMethod · 0.85
process_module_mapMethod · 0.85
cleanMethod · 0.85
collect_status_entriesFunction · 0.85

Calls 1

Tested by

no test coverage detected