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

Function GetShellConfigFilePath

utils/shell_utils.go:36–53  ·  view source on GitHub ↗

GetShellConfigFilePath retorna o caminho do arquivo de configuração do shell com base no nome do shell.

(shellName string)

Source from the content-addressed store, hash-verified

34
35// GetShellConfigFilePath retorna o caminho do arquivo de configuração do shell com base no nome do shell.
36func GetShellConfigFilePath(shellName string) string {
37 homeDir, err := GetHomeDir()
38 if err != nil {
39 fmt.Println("Erro ao obter o diretório home do usuário:", err)
40 return ""
41 }
42
43 switch shellName {
44 case "zsh":
45 return filepath.Join(homeDir, ".zshrc")
46 case "bash":
47 return filepath.Join(homeDir, ".bashrc")
48 case "fish":
49 return filepath.Join(homeDir, ".config", "fish", "config.fish")
50 default:
51 return ""
52 }
53}
54
55// GetShellHistoryFile retorna o caminho do arquivo de histórico do shell.
56func GetShellHistoryFile() (string, error) {

Callers 1

executeDirectCommandMethod · 0.92

Calls 1

GetHomeDirFunction · 0.85

Tested by

no test coverage detected