fix(#1013): make write private — only set_groups and remove_agent are the write paths
This commit is contained in:
parent
8c836039d3
commit
93ecbcb879
1 changed files with 3 additions and 4 deletions
|
|
@ -56,10 +56,9 @@ pub fn groups_for(name: &str) -> Vec<String> {
|
|||
}
|
||||
|
||||
/// Persist the full tool-groups map. Sorted JSON output keeps diffs
|
||||
/// minimal. Best-effort — returns `io::Error` so callers decide
|
||||
/// whether to abort or log. Prefer `set_groups` over calling this
|
||||
/// directly — `set_groups` validates group names before writing.
|
||||
pub fn write(map: &BTreeMap<String, Vec<String>>) -> std::io::Result<()> {
|
||||
/// minimal. Use `set_groups` (or `remove_agent`) from outside this
|
||||
/// module — they go through the validated write path.
|
||||
fn write(map: &BTreeMap<String, Vec<String>>) -> std::io::Result<()> {
|
||||
let path = tool_groups_path();
|
||||
if let Some(parent) = path.parent() {
|
||||
std::fs::create_dir_all(parent)?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue