From 61b3b87c4501164a3470526e2163121bc1e9deb8 Mon Sep 17 00:00:00 2001 From: Nelson Chen Date: Sat, 30 Jan 2021 00:17:26 -0700 Subject: [PATCH 1/2] Make opening URLs not fatal if a web browser cannot be opened from the terminal This is useful for environments where a launching a Desktop web browser from the terminal is unavailable or inaccessible. For me, that would WSL out of the box on Windows. A similar pattern can be seen in Google CLIs. Closes #89 --- internal/util/web.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/util/web.go b/internal/util/web.go index 190ff21..825f386 100644 --- a/internal/util/web.go +++ b/internal/util/web.go @@ -15,7 +15,8 @@ type WebUtil struct { func (w *WebUtil) OpenURL(url string) { if err := browser.OpenURL(url); err != nil { - log.Fatalln("Error opening web browser", err) + log.Errorln("Error opening web browser", err) + log.Infoln("Please copy and visit the following URL in your browser:", url) } } From d25746181b3c00701e2ccddb1aac2b6158038781 Mon Sep 17 00:00:00 2001 From: Nelson Chen Date: Sat, 30 Jan 2021 00:25:54 -0700 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b820201..7714c1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fix bug causing prompts to repeatedly echo input of large strings - dce leases end command can now accept leaseID +- Print out browser URL to be copied and opened in case opening the browser from the Terminal fails such as out of the box on WSL2. ## v0.5.0