(blockMeta waveobj.MetaMapType)
| 673 | } |
| 674 | |
| 675 | func getLocalShellPath(blockMeta waveobj.MetaMapType) (string, error) { |
| 676 | shellPath := blockMeta.GetString(waveobj.MetaKey_TermLocalShellPath, "") |
| 677 | if shellPath != "" { |
| 678 | return shellPath, nil |
| 679 | } |
| 680 | |
| 681 | connName := blockMeta.GetString(waveobj.MetaKey_Connection, "") |
| 682 | if strings.HasPrefix(connName, "local:") { |
| 683 | variant := strings.TrimPrefix(connName, "local:") |
| 684 | if variant == LocalConnVariant_GitBash { |
| 685 | if runtime.GOOS != "windows" { |
| 686 | return "", fmt.Errorf("connection \"local:gitbash\" is only supported on Windows") |
| 687 | } |
| 688 | fullConfig := wconfig.GetWatcher().GetFullConfig() |
| 689 | gitBashPath := shellutil.FindGitBash(&fullConfig, false) |
| 690 | if gitBashPath == "" { |
| 691 | return "", fmt.Errorf("connection \"local:gitbash\": git bash not found on this system, please install Git for Windows or set term:localshellpath to specify the git bash location") |
| 692 | } |
| 693 | return gitBashPath, nil |
| 694 | } |
| 695 | return "", fmt.Errorf("unsupported local connection type: %q", connName) |
| 696 | } |
| 697 | |
| 698 | settings := wconfig.GetWatcher().GetFullConfig().Settings |
| 699 | if settings.TermLocalShellPath != "" { |
| 700 | return settings.TermLocalShellPath, nil |
| 701 | } |
| 702 | return shellutil.DetectLocalShellPath(), nil |
| 703 | } |
| 704 | |
| 705 | func getLocalShellOpts(blockMeta waveobj.MetaMapType) []string { |
| 706 | if blockMeta.HasKey(waveobj.MetaKey_TermLocalShellOpts) { |
no test coverage detected