File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed
internal/package/prompter Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ require (
66 github.com/blang/semver v3.5.1+incompatible
77 github.com/manifoldco/promptui v0.7.0
88 github.com/rhysd/go-github-selfupdate v1.2.2
9+ github.com/toqueteos/webbrowser v1.2.0
910)
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ github.com/rhysd/go-github-selfupdate v1.2.2 h1:G+mNzkc1wEtpmM6sFS/Ghkeq+ad4Yp6E
4242github.com/rhysd/go-github-selfupdate v1.2.2 /go.mod h1:khesvSyKcXDUxeySCedFh621iawCks0dS/QnHPcpCws =
4343github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw =
4444github.com/tcnksm/go-gitconfig v0.1.2 /go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE =
45+ github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ =
46+ github.com/toqueteos/webbrowser v1.2.0 /go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM =
4547github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok =
4648github.com/ulikunitz/xz v0.5.5 /go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8 =
4749golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M =
Original file line number Diff line number Diff line change @@ -2,11 +2,10 @@ package prompter
22
33import (
44 "math/rand"
5- "os/exec"
6- "runtime"
75 "strings"
86 "time"
97
8+ "github.com/toqueteos/webbrowser"
109 "github.com/umutphp/awesome-cli/internal/package/fetcher"
1110 "github.com/umutphp/awesome-cli/internal/package/manager"
1211 "github.com/umutphp/awesome-cli/internal/package/node"
@@ -161,14 +160,5 @@ func PromptToContinue() string {
161160}
162161
163162func OpenInBrowser (url string ) {
164- switch runtime .GOOS {
165- case "linux" :
166- exec .Command ("xdg-open" , url ).Start ()
167- case "windows" :
168- exec .Command ("rundll32" , "url.dll,FileProtocolHandler" , url ).Start ()
169- case "darwin" :
170- exec .Command ("open" , url ).Start ()
171- default :
172- // Unsupported platform, nothing to do
173- }
163+ webbrowser .Open (url )
174164}
You can’t perform that action at this time.
0 commit comments