()
| 29 | ) |
| 30 | |
| 31 | func CurrentShell() ShellType { |
| 32 | switch runtime.GOOS { |
| 33 | case "windows": |
| 34 | return TypePowerShell |
| 35 | |
| 36 | case "linux": |
| 37 | shell := os.Getenv("SHELL") |
| 38 | switch shell { |
| 39 | case "/usr/bin/bash", "/bin/bash": |
| 40 | return BashShell |
| 41 | case "/usr/bin/zsh", "/bin/zsh": |
| 42 | return ZshShell |
| 43 | default: |
| 44 | return NotSupported |
| 45 | } |
| 46 | |
| 47 | default: |
| 48 | panic("unsupported os: " + runtime.GOOS) |
| 49 | } |
| 50 | } |
no outgoing calls