(args []string)
| 32 | } |
| 33 | |
| 34 | func (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 | } |
nothing calls this directly
no test coverage detected