(args []string, retVal *bool)
| 167 | } |
| 168 | |
| 169 | func (cmd *CliRpcCmd) CallCoreCommand(args []string, retVal *bool) error { |
| 170 | var err error |
| 171 | cmdRegistry := commandregistry.Commands |
| 172 | |
| 173 | cmd.outputBucket = &bytes.Buffer{} |
| 174 | cmd.outputCapture.SetOutputBucket(cmd.outputBucket) |
| 175 | |
| 176 | if cmdRegistry.CommandExists(args[0]) { |
| 177 | deps := commandregistry.NewDependency(cmd.stdout, cmd.logger, dialTimeout) |
| 178 | |
| 179 | // set deps objs to be the one used by all other commands |
| 180 | // once all commands are converted, we can make fresh deps for each command run |
| 181 | deps.Config = cmd.cliConfig |
| 182 | deps.RepoLocator = cmd.repoLocator |
| 183 | |
| 184 | // set command ui's TeePrinter to be the one used by RpcService, for output to be captured |
| 185 | deps.UI = terminal.NewUI(os.Stdin, cmd.stdout, cmd.outputCapture.(*terminal.TeePrinter), cmd.logger) |
| 186 | |
| 187 | err = cmd.newCmdRunner.Command(args, deps, false) |
| 188 | } else { |
| 189 | *retVal = false |
| 190 | return nil |
| 191 | } |
| 192 | |
| 193 | if err != nil { |
| 194 | *retVal = false |
| 195 | return err |
| 196 | } |
| 197 | |
| 198 | *retVal = true |
| 199 | return nil |
| 200 | } |
| 201 | |
| 202 | func (cmd *CliRpcCmd) GetOutputAndReset(args bool, retVal *[]string) error { |
| 203 | v := strings.TrimSuffix(cmd.outputBucket.String(), "\n") |
nothing calls this directly
no test coverage detected