(name string, dryRun bool)
| 93 | } |
| 94 | |
| 95 | func (s *ToolService) Uninstall(name string, dryRun bool) (OperationResult, error) { |
| 96 | tool, err := loadTool(name) |
| 97 | if err != nil { |
| 98 | return OperationResult{}, err |
| 99 | } |
| 100 | if dryRun { |
| 101 | return OperationResult{OK: true, Message: "uninstall " + tool.LaunchCommand()}, nil |
| 102 | } |
| 103 | var stdout, stderr bytes.Buffer |
| 104 | code, msg, err := tools.Uninstall(tool, nil, &stdout, &stderr) |
| 105 | if err != nil { |
| 106 | return OperationResult{}, wrapError("TOOL_UNINSTALL_FAILED", err) |
| 107 | } |
| 108 | return OperationResult{OK: code == 0, Message: msg + "\n" + stdout.String() + stderr.String()}, nil |
| 109 | } |
| 110 | |
| 111 | func (s *ToolService) Upgrade(name string, dryRun bool) (OperationResult, error) { |
| 112 | return s.Install(name, dryRun) |
nothing calls this directly
no test coverage detected