Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: provide helpful error when no login url specified
  • Loading branch information
f0ssel committed Dec 8, 2023
commit 351b848269f3b6da680a1ef39a7d75d732050d8a
4 changes: 4 additions & 0 deletions cli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ func (r *RootCmd) login() *clibase.Cmd {
rawURL = inv.Args[0]
}

if rawURL == "" {
return xerrors.Errorf("no url argument provided")
}

if !strings.HasPrefix(rawURL, "http://") && !strings.HasPrefix(rawURL, "https://") {
scheme := "https"
if strings.HasPrefix(rawURL, "localhost") {
Expand Down