processGitCommand adiciona informações do Git ao contexto
(userInput string)
| 91 | |
| 92 | // processGitCommand adiciona informações do Git ao contexto |
| 93 | func (cli *ChatCLI) processGitCommand(userInput string) (string, string) { |
| 94 | var additionalContext string |
| 95 | if strings.Contains(strings.ToLower(userInput), "@git") { |
| 96 | executor := utils.NewOSCommandExecutor() |
| 97 | gitData, err := utils.GetGitInfo(executor) |
| 98 | if err != nil { |
| 99 | cli.logger.Error("Erro ao obter informações do Git", zap.Error(err)) |
| 100 | } else { |
| 101 | additionalContext += "\n" + i18n.T("command.context.git_info") + ":\n" + gitData |
| 102 | } |
| 103 | userInput = removeCommandAndNormalizeSpaces(userInput, "@git") |
| 104 | } |
| 105 | return userInput, additionalContext |
| 106 | } |
| 107 | |
| 108 | // processEnvCommand adiciona as variáveis de ambiente ao contexto |
| 109 | func (cli *ChatCLI) processEnvCommand(userInput string) (string, string) { |
no test coverage detected