()
| 85 | ) |
| 86 | |
| 87 | func DetectLocalShellPath() string { |
| 88 | if runtime.GOOS == "windows" { |
| 89 | if pwshPath, lpErr := exec.LookPath("pwsh"); lpErr == nil { |
| 90 | return pwshPath |
| 91 | } |
| 92 | if powershellPath, lpErr := exec.LookPath("powershell"); lpErr == nil { |
| 93 | return powershellPath |
| 94 | } |
| 95 | return "powershell.exe" |
| 96 | } |
| 97 | shellPath := GetMacUserShell() |
| 98 | if shellPath == "" { |
| 99 | shellPath = os.Getenv("SHELL") |
| 100 | } |
| 101 | if shellPath == "" { |
| 102 | return DefaultShellPath |
| 103 | } |
| 104 | return shellPath |
| 105 | } |
| 106 | |
| 107 | func GetMacUserShell() string { |
| 108 | if runtime.GOOS != "darwin" { |
no test coverage detected