fix: output an error if not cloudflare token provided

This commit is contained in:
2025-12-01 14:47:16 +01:00
parent 46e8ebdb72
commit c944aaff40

View File

@@ -15,8 +15,13 @@ func main() {
log.Println(err)
os.Exit(1)
}
// Init Cloudflare client
cloudflareApiToken := os.Getenv("CLOUDFLARE_TOKEN")
if len(cloudflareApiToken) == 0 {
log.Println("Error: you need to provide a Cloudflare API token")
os.Exit(1)
}
cf := cloudflare.NewApiClient(cloudflareApiToken)
for _, c := range configs {