MCPcopy Index your code
hub / github.com/koding/kite / Run

Method Run

kitectl/command/uninstall.go:38–70  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

36}
37
38func (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"

Callers

nothing calls this directly

Calls 4

HelpMethod · 0.95
isInstalledFunction · 0.85
getBundlePathFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected