MCPcopy Create free account
hub / github.com/diillson/chatcli / getEnvFilePath

Method getEnvFilePath

cli/cli_config.go:413–424  ·  view source on GitHub ↗

getEnvFilePath retorna o caminho do arquivo .env configurado (expandido).

()

Source from the content-addressed store, hash-verified

411
412// getEnvFilePath retorna o caminho do arquivo .env configurado (expandido).
413func (cli *ChatCLI) getEnvFilePath() string {
414 envFilePath := os.Getenv("CHATCLI_DOTENV")
415 if envFilePath == "" {
416 envFilePath = ".env"
417 }
418 expanded, err := utils.ExpandPath(envFilePath)
419 if err != nil {
420 cli.logger.Warn("Não foi possível expandir o caminho do .env", zap.Error(err))
421 return envFilePath // Retorna o original se falhar
422 }
423 return expanded
424}
425
426func (ch *CommandHandler) handleVersionCommand(ctx context.Context) {
427 versionInfo := version.GetCurrentVersion()

Callers 1

showConfigGeneralMethod · 0.95

Calls 3

ExpandPathFunction · 0.92
WarnMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected