MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Run

Method Run

cmd/remove/plugin.go:36–57  ·  view source on GitHub ↗

Run executes the command logic

(f factory.Factory, cobraCmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

34
35// Run executes the command logic
36func (cmd *pluginCmd) Run(f factory.Factory, cobraCmd *cobra.Command, args []string) error {
37 pluginManager := f.NewPluginManager(f.GetLog())
38 _, oldPlugin, err := pluginManager.GetByName(args[0])
39 if err != nil {
40 return err
41 } else if oldPlugin != nil {
42 // Execute plugin hook
43 err = plugin.ExecutePluginHookAt(*oldPlugin, "before:removePlugin", "before_remove")
44 if err != nil {
45 return err
46 }
47 }
48
49 f.GetLog().Info("Removing plugin " + args[0] + "...")
50 err = pluginManager.Remove(args[0])
51 if err != nil {
52 return err
53 }
54
55 f.GetLog().Donef("Successfully removed plugin %s", args[0])
56 return nil
57}

Callers 1

newPluginCmdFunction · 0.95

Calls 7

ExecutePluginHookAtFunction · 0.92
NewPluginManagerMethod · 0.65
GetLogMethod · 0.65
GetByNameMethod · 0.65
RemoveMethod · 0.65
InfoMethod · 0.45
DonefMethod · 0.45

Tested by

no test coverage detected