devhindo / x

post tweets from terminal
https://x-blush.vercel.app
MIT License
27 stars 2 forks source link

Add error handling for checking if the machine doesn't have a command to open browser #50

Open devhindo opened 1 month ago

devhindo commented 1 month ago

Extracted from #46

Error Message:

./x auth panic: exec: "xdg-open": executable file not found in $PATH

goroutine 1 [running]: github.com/devhindo/x/src/cli/utils.OpenBrowser(...) /home/devhindo/gh/x/src/cli/utils/open.go:11 github.com/devhindo/x/src/cli/auth.(*User).open_browser_to_auth_url(...) /home/devhindo/gh/x/src/cli/auth/user.go:45 github.com/devhindo/x/src/cli/auth.Auth() /home/devhindo/gh/x/src/cli/auth/auth.go:18 +0xd6 github.com/devhindo/x/src/cli/x.HandleArgs() /home/devhindo/gh/x/src/cli/x/args.go:28 +0x2e5 github.com/devhindo/x/src/cli/x.Run(...) /home/devhindo/gh/x/src/cli/x/run.go:4 main.main() /home/devhindo/gh/x/src/cli/main.go:7 +0x10

Can't open your browser, please validate using your favorite browser.