Skip to content

Commit 5f568c7

Browse files
committed
Adds check / warning log for proper FA configuration
1 parent 54dacfc commit 5f568c7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cmd/root.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"fmt"
2626
"os"
2727

28+
"github.com/fatih/color"
2829
"github.com/joho/godotenv"
2930
"github.com/spf13/cobra"
3031
)
@@ -66,6 +67,12 @@ func init() {
6667
TenantID = os.Getenv("FA_TENANT_ID")
6768
APIKey = os.Getenv("FA_API_KEY")
6869

70+
if ClientID == "TODO" || TenantID == "TODO" || APIKey == "TODO" {
71+
red := color.New(color.FgRed, color.Bold)
72+
red.Printf("You need to finish the setup and add your FA configuration to `.env`. Do so and come back!\n")
73+
os.Exit(1)
74+
}
75+
6976
rootCmd.AddCommand(LoginCmd)
7077
rootCmd.AddCommand(LogoutCmd)
7178
rootCmd.AddCommand(FetchCmd)

0 commit comments

Comments
 (0)