GetShellConfigFilePath retorna o caminho do arquivo de configuração do shell com base no nome do shell.
(shellName string)
| 34 | |
| 35 | // GetShellConfigFilePath retorna o caminho do arquivo de configuração do shell com base no nome do shell. |
| 36 | func 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. |
| 56 | func GetShellHistoryFile() (string, error) { |
no test coverage detected