(name string)
| 113 | } |
| 114 | |
| 115 | func loadTool(name string) (tools.Tool, error) { |
| 116 | registry, err := tools.LoadDefault() |
| 117 | if err != nil { |
| 118 | return tools.Tool{}, wrapError("TOOL_REGISTRY_LOAD_FAILED", err) |
| 119 | } |
| 120 | tool, ok := registry.Get(name) |
| 121 | if !ok { |
| 122 | if byCommand, found := registry.ByCLICommand(name); found { |
| 123 | return byCommand, nil |
| 124 | } |
| 125 | return tools.Tool{}, NewError("TOOL_NOT_FOUND", "tool not found", map[string]string{"name": name}) |
| 126 | } |
| 127 | return tool, nil |
| 128 | } |
| 129 | |
| 130 | func toolDTO(tool tools.Tool) ToolDTO { |
| 131 | installed, version := tools.Detect(tool) |
no test coverage detected