Skip to content

Commit 8cb6d3f

Browse files
committed
Error out if required config is absent
There's no point to continue if Client ID and/or Client Secret are missing.
1 parent add5f5a commit 8cb6d3f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ func main() {
6464
clientSecret = viper.GetString("client-secret")
6565
}
6666

67+
if clientID == "" {
68+
fmt.Println("No Client ID specified.")
69+
os.Exit(1)
70+
}
71+
72+
if clientSecret == "" {
73+
fmt.Println("No Client Secret specified.")
74+
os.Exit(1)
75+
}
76+
6777
helper.LaunchBrowser(viper.GetBool("open"), oauthUrl, clientID)
6878

6979
reader := bufio.NewReader(os.Stdin)

0 commit comments

Comments
 (0)