File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ func openBrowser(url string) {
146
146
openCmd = exec .Command ("chromium-browser" , fmtChromeOptions (url )... )
147
147
case commandExists ("firefox" ):
148
148
openCmd = exec .Command ("firefox" , "--url=" + url , "-safe-mode" )
149
+ case pathExists ("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ):
150
+ openCmd = exec .Command ("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" , fmtChromeOptions (url )... )
149
151
default :
150
152
flog .Info ("unable to find a browser to open: sshcode only supports firefox, chrome, and chromium" )
151
153
}
@@ -166,6 +168,11 @@ func commandExists(name string) bool {
166
168
return err == nil
167
169
}
168
170
171
+ func pathExists (name string ) bool {
172
+ _ , err := os .Stat (name )
173
+ return err == nil
174
+ }
175
+
169
176
// randomPort picks a random port to start code-server on.
170
177
func randomPort () (string , error ) {
171
178
const (
You can’t perform that action at this time.
0 commit comments