Skip to content

Commit

Permalink
Error out if required config is absent
Browse files Browse the repository at this point in the history
There's no point to continue if Client ID and/or Client Secret are missing.
  • Loading branch information
twz123 committed Feb 22, 2018
1 parent add5f5a commit 8cb6d3f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ func main() {
clientSecret = viper.GetString("client-secret")
}

if clientID == "" {
fmt.Println("No Client ID specified.")
os.Exit(1)
}

if clientSecret == "" {
fmt.Println("No Client Secret specified.")
os.Exit(1)
}

helper.LaunchBrowser(viper.GetBool("open"), oauthUrl, clientID)

reader := bufio.NewReader(os.Stdin)
Expand Down

0 comments on commit 8cb6d3f

Please sign in to comment.