MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Execute

Method Execute

command/plugin/add_plugin_repo_command.go:34–54  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

32}
33
34func (cmd AddPluginRepoCommand) Execute(args []string) error {
35 err := cmd.Actor.AddPluginRepository(cmd.RequiredArgs.PluginRepoName, cmd.RequiredArgs.PluginRepoURL)
36 switch e := err.(type) {
37 case actionerror.RepositoryAlreadyExistsError:
38 cmd.UI.DisplayTextWithFlavor("{{.RepositoryURL}} already registered as {{.RepositoryName}}",
39 map[string]interface{}{
40 "RepositoryName": e.Name,
41 "RepositoryURL": e.URL,
42 })
43 case nil:
44 cmd.UI.DisplayTextWithFlavor("{{.RepositoryURL}} added as {{.RepositoryName}}",
45 map[string]interface{}{
46 "RepositoryName": cmd.RequiredArgs.PluginRepoName,
47 "RepositoryURL": cmd.RequiredArgs.PluginRepoURL,
48 })
49 default:
50 return err
51 }
52
53 return nil
54}

Callers

nothing calls this directly

Calls 2

AddPluginRepositoryMethod · 0.65
DisplayTextWithFlavorMethod · 0.65

Tested by

no test coverage detected