From 67525483c541962dd31ae73590d622f1b86ab4e3 Mon Sep 17 00:00:00 2001 From: peefy Date: Sun, 14 Jan 2024 21:22:58 +0800 Subject: [PATCH] feat: use data template in the config template Signed-off-by: peefy --- pkg/tools/gen/templates/kcl/config.gotmpl | 26 +---------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/pkg/tools/gen/templates/kcl/config.gotmpl b/pkg/tools/gen/templates/kcl/config.gotmpl index 05c2946d..45e2dd85 100644 --- a/pkg/tools/gen/templates/kcl/config.gotmpl +++ b/pkg/tools/gen/templates/kcl/config.gotmpl @@ -1,29 +1,5 @@ {{- if .Var }}{{ formatName .Var }}{{- if .IsUnion }}{{ " : " }}{{- else }}{{ " = " }}{{- end }}{{- end }}{{- if .Name }}{{ formatName .Name }}{{- end }}{{- if .Data }}{{- "{\n" }} {{- range .Data -}} -{{- " " }}{{ formatName .Key }}{{ " = " }} - {{- if isKclData .Value }} - {{- "{\n" }} - {{- range .Value -}} - {{- indentLines (include "data" .) " " }} - {{- end }} - {{- " }" }} - {{- else if isArray .Value }} - {{- "[\n" }} - {{- range .Value -}} - {{- if isKclData . }} - {{- " {\n" }} - {{- range . -}} - {{- indentLines (include "data" .) " " }} - {{- end }} - {{- " }\n" }} - {{- else }} - {{- indentLines (formatValue .) " " }}{{- "\n" }} - {{- end }} - {{- end }} - {{- " ]" }} - {{- else }} - {{- formatValue .Value }} - {{- end }} - {{- "\n" }} +{{- indentLines (include "data" .) " " }} {{- end -}} {{- "}" }}{{- else }}{}{{- end }}