(args []string)
| 36 | } |
| 37 | |
| 38 | func (c *Uninstall) Run(args []string) int { |
| 39 | |
| 40 | if len(args) != 1 { |
| 41 | c.Ui.Output(c.Help()) |
| 42 | return 1 |
| 43 | } |
| 44 | fullName := args[0] |
| 45 | |
| 46 | installed, err := isInstalled(fullName) |
| 47 | if err != nil { |
| 48 | c.Ui.Error(err.Error()) |
| 49 | return 1 |
| 50 | } |
| 51 | |
| 52 | if !installed { |
| 53 | c.Ui.Error(fmt.Sprintf("%s is not installed", fullName)) |
| 54 | return 1 |
| 55 | } |
| 56 | |
| 57 | bundlePath, err := getBundlePath(fullName) |
| 58 | if err != nil { |
| 59 | c.Ui.Error(err.Error()) |
| 60 | return 1 |
| 61 | } |
| 62 | |
| 63 | err = os.RemoveAll(bundlePath) |
| 64 | if err != nil { |
| 65 | c.Ui.Error(err.Error()) |
| 66 | return 1 |
| 67 | } |
| 68 | |
| 69 | return 0 |
| 70 | } |
| 71 | |
| 72 | // getBundlePath returns the bundle path of a given kite. |
| 73 | // Example: "adsf-1.2.3" -> "~/.kd/kites/asdf-1.2.3.kite" |
nothing calls this directly
no test coverage detected