diff --git a/docs/helpers/rogueEnv.go b/docs/helpers/rogueEnv.go index 28eab2d493..d6e00de052 100644 --- a/docs/helpers/rogueEnv.go +++ b/docs/helpers/rogueEnv.go @@ -55,14 +55,15 @@ func GetRogueEnvs() { log.Fatal(err) } fmt.Println("Gathering variable definitions from source") - out, err := exec.Command("bash", "-c", "grep -R os.Getenv | grep -v rogue-env.go").Output() + out, err := exec.Command("bash", "-c", "grep -R os.Getenv | grep -v rogue-env.go |grep \\.go").Output() if err != nil { log.Fatal(err) } lines := strings.Split(string(out), "\n") for _, l := range lines { r := strings.SplitN(l, ":\t", 2) - if r[0] != "" && r[1] != "" { + if len(r) == 2 && r[0] != "" && r[1] != "" { + fmt.Printf("Parsing %s\n", r[0]) res := re.FindAll([]byte(r[1]), -1) for _, item := range res { AddUniqueToStruct(vars, Variable{Name: strings.Trim(string(item), "\""), Type: ""}) @@ -76,7 +77,7 @@ func GetRogueEnvs() { fmt.Printf("Writing new variable definitions to %s\n", fullYamlPath) err = ioutil.WriteFile(fullYamlPath, output, 0666) if err != nil { - log.Fatal("could not write %s", fullYamlPath) + log.Fatalf("could not write %s", fullYamlPath) } if err := os.Chdir(curdir); err != nil { log.Fatal(err) diff --git a/docs/templates/ADOC_global.tmpl b/docs/templates/ADOC_global.tmpl index dca1dd9988..6e21fb482e 100644 --- a/docs/templates/ADOC_global.tmpl +++ b/docs/templates/ADOC_global.tmpl @@ -1,13 +1,13 @@ -// set the attribute to true or leave empty, true without any quotes. +// collected through docs/helpers/rougeEnv.go [caption=] -.Global environment Variables +.Environment variables with global scope not included in a service [width="100%",cols="~,~,~,~",options="header"] -| === | -| Name | -| Type | -| Default Value | -| Description | +|=== +| Name +| Type +| Default Value +| Description {{- range .Variables}} @@ -20,4 +20,4 @@ a| [subs=-attributes] {{.Description}} {{- end }} -| === | +|===