Skip to content

Commit

Permalink
Merge pull request #305 from DopplerHQ/login-url
Browse files Browse the repository at this point in the history
chore: always print login url
  • Loading branch information
Piccirello authored Apr 18, 2022
2 parents 0f1a139 + d2448cd commit dd540e0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,18 @@ var loginCmd = &cobra.Command{
}

openBrowser := yes || utils.Silent || utils.ConfirmationPrompt("Open the authorization page in your browser?", true)
printURL := !openBrowser
if openBrowser {
if err := open.Run(authURL); err != nil {
if utils.Silent {
utils.HandleError(err, "Unable to launch a browser")
}

printURL = true
utils.Log("Unable to launch a browser")
utils.LogDebugError(err)
}
}

if printURL {
utils.Print(fmt.Sprintf("Complete authorization at %s", authURL))
}
utils.Print(fmt.Sprintf("Complete authorization at %s", authURL))
utils.Print(fmt.Sprintf("Your auth code is:\n%s\n", color.Green.Render(code)))
utils.Print("Waiting...")

Expand Down

0 comments on commit dd540e0

Please sign in to comment.