File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,29 @@ package oscommands
66import (
77 "os"
88 "runtime"
9+ "strings"
910)
1011
1112func GetPlatform () * Platform {
13+ shell := getUserShell ()
14+
15+ interactiveShell := shell
16+ interactiveShellArg := "-i"
17+ interactiveShellExit := "; exit $?"
18+
19+ if ! (strings .HasSuffix (shell , "bash" ) || strings .HasSuffix (shell , "zsh" )) {
20+ interactiveShell = "bash"
21+ interactiveShellArg = ""
22+ interactiveShellExit = ""
23+ }
24+
1225 return & Platform {
1326 OS : runtime .GOOS ,
1427 Shell : "bash" ,
15- InteractiveShell : getUserShell () ,
28+ InteractiveShell : interactiveShell ,
1629 ShellArg : "-c" ,
17- InteractiveShellArg : "-i" ,
18- InteractiveShellExit : "; exit $?" ,
30+ InteractiveShellArg : interactiveShellArg ,
31+ InteractiveShellExit : interactiveShellExit ,
1932 OpenCommand : "open {{filename}}" ,
2033 OpenLinkCommand : "open {{link}}" ,
2134 }
You can’t perform that action at this time.
0 commit comments