NewShellManager creates a new ShellManager based on the current shell.
()
| 25 | |
| 26 | // NewShellManager creates a new ShellManager based on the current shell. |
| 27 | func NewShellManager() (ShellManager, error) { |
| 28 | shell := os.Getenv("SHELL") |
| 29 | for name, factory := range shellFactories { |
| 30 | if strings.Contains(shell, name) { |
| 31 | return factory(), nil |
| 32 | } |
| 33 | } |
| 34 | return nil, fmt.Errorf("unsupported shell: %s", shell) |
| 35 | } |
nothing calls this directly
no outgoing calls
no test coverage detected