1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

get-zones now outputs END); notation and prettier whitespace (#2849)

This commit is contained in:
Tom Limoncelli
2024-02-27 15:11:13 -05:00
committed by GitHub
parent 11d8e08ca0
commit 544d731dec
9 changed files with 30 additions and 11 deletions

View File

@@ -220,7 +220,7 @@ func GetZone(args GetZoneArgs) error {
fmt.Fprintf(w, `var %s = NewDnsProvider("%s", "%s");`+"\n",
dspVariableName, args.CredName, args.ProviderName)
}
fmt.Fprintf(w, `var REG_CHANGEME = NewRegistrar("none");`+"\n")
fmt.Fprintf(w, `var REG_CHANGEME = NewRegistrar("none");`+"\n\n")
}
// print each zone
@@ -267,14 +267,17 @@ func GetZone(args GetZoneArgs) error {
"//, NOTE: CNAME at apex may require manual editing.",
"// NOTE: CNAME at apex may require manual editing.",
)
fmt.Fprint(w, out)
fmt.Fprint(w, "\n)\n\n")
} else {
out = out + ","
out = strings.ReplaceAll(out,
"// NOTE: CNAME at apex may require manual editing.,",
"// NOTE: CNAME at apex may require manual editing.",
)
fmt.Fprint(w, out)
fmt.Fprint(w, "\nEND);\n\n")
}
fmt.Fprint(w, out)
fmt.Fprint(w, "\n)\n")
case "tsv":
for _, rec := range recs {