termux-packages/packages/hub/utils-utils.go.patch
2018-06-04 00:42:01 +02:00

41 lines
1012 B
Diff

diff -u -r ../hub-2.3.0/utils/utils.go ./utils/utils.go
--- ../hub-2.3.0/utils/utils.go 2018-05-29 15:34:37.000000000 +0200
+++ ./utils/utils.go 2018-05-30 02:41:45.923963648 +0200
@@ -28,7 +26,7 @@
func BrowserLauncher() ([]string, error) {
browser := os.Getenv("BROWSER")
if browser == "" {
- browser = searchBrowserLauncher(runtime.GOOS)
+ browser = "termux-open"
}
if browser == "" {
@@ -38,27 +36,6 @@
return strings.Split(browser, " "), nil
}
-func searchBrowserLauncher(goos string) (browser string) {
- switch goos {
- case "darwin":
- browser = "open"
- case "windows":
- browser = "cmd /c start"
- default:
- candidates := []string{"xdg-open", "cygstart", "x-www-browser", "firefox",
- "opera", "mozilla", "netscape"}
- for _, b := range candidates {
- path, err := exec.LookPath(b)
- if err == nil {
- browser = path
- break
- }
- }
- }
-
- return browser
-}
-
func CommandPath(cmd string) (string, error) {
if runtime.GOOS == "windows" {
cmd = cmd + ".exe"