()
| 755 | } |
| 756 | |
| 757 | fn uninstall_from_codex() -> Result<(), Box<dyn std::error::Error>> { |
| 758 | let config_path = codex_config_path(); |
| 759 | if config_path.exists() { |
| 760 | let content = std::fs::read_to_string(&config_path)?; |
| 761 | let header = "[mcp_servers.codeseek]"; |
| 762 | if content.contains(header) { |
| 763 | let start = content.find(header).unwrap(); |
| 764 | let end = content[start..] |
| 765 | .find("\n[") |
| 766 | .map(|i| start + i) |
| 767 | .unwrap_or(content.len()); |
| 768 | let mut updated = content[..start].to_string(); |
| 769 | if end < content.len() { |
| 770 | updated.push_str(&content[end..]); |
| 771 | } |
| 772 | std::fs::write(&config_path, updated.trim())?; |
| 773 | println!(" ✓ Removed from {}", config_path.display()); |
| 774 | } |
| 775 | } |
| 776 | Ok(()) |
| 777 | } |
no test coverage detected