Add output to configenvextractor

This commit is contained in:
Christian Richter
2022-03-02 15:14:47 +01:00
parent 63818e0fa4
commit 4f18908016
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -22,6 +22,7 @@ type ConfigField struct {
}
func main() {
fmt.Println("Generating documentation for environment variables:")
content, err := ioutil.ReadFile("../../../docs/templates/CONFIGURATION.tmpl")
if err != nil {
log.Fatal(err)
@@ -44,6 +45,7 @@ m := map[string]interface{}{
for pkg, conf := range m {
fields = GetAnnotatedVariables(conf)
if len(fields) > 0 {
fmt.Printf("... %s\n", pkg)
targetFile, err = os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "_configvars.md"))
if err != nil {
log.Fatalf("Failed to create target file: %s", err)
@@ -54,6 +56,7 @@ m := map[string]interface{}{
}
}
}
fmt.Println("done")
}
func GetAnnotatedVariables(s interface{}) []ConfigField {