Bugfixing

Co-authored-by: Martin <github@diemattels.at>
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2022-12-01 09:59:10 +01:00
committed by mmattel
parent 8817d634bd
commit 879f7996e3
2 changed files with 12 additions and 11 deletions

View File

@@ -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)

View File

@@ -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 }}
| === |
|===