Run runs this plugin
(cliConnection plugin.CliConnection, args []string)
| 35 | |
| 36 | // Run runs this plugin |
| 37 | func (p *MultiappsPlugin) Run(cliConnection plugin.CliConnection, args []string) { |
| 38 | disableStdOut() |
| 39 | if args[0] == "CLI-MESSAGE-UNINSTALL" { |
| 40 | return |
| 41 | } |
| 42 | command, err := findCommand(args[0]) |
| 43 | if err != nil { |
| 44 | log.Fatalln(err) |
| 45 | } |
| 46 | versionOutput, err := cliConnection.CliCommandWithoutTerminalOutput("version") |
| 47 | if err != nil { |
| 48 | log.Traceln(err) |
| 49 | versionOutput = []string{util.DefaultCliVersion} |
| 50 | } |
| 51 | util.SetCfCliVersion(strings.Join(versionOutput, " ")) |
| 52 | util.SetPluginVersion(Version) |
| 53 | command.Initialize(command.GetPluginCommand().Name, cliConnection) |
| 54 | status := command.Execute(args[1:]) |
| 55 | if status == commands.Failure { |
| 56 | os.Exit(1) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // GetMetadata returns the metadata of this plugin |
| 61 | func (p *MultiappsPlugin) GetMetadata() plugin.PluginMetadata { |
nothing calls this directly
no test coverage detected