fix: fix filelist in template #83
@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"{{ ds "type" }}": [
|
"{{ ds "type" }}": [
|
||||||
{{- $path := ds "source" }}
|
{{- $path := ds "source" }}
|
||||||
{{- $filelist := file.ReadDir $path }}
|
{{- $filelist := coll.Slice }}
|
||||||
{{- $length := len $filelist}}
|
{{- range $item := file.ReadDir $path }}
|
||||||
{{- range $i, $item := $filelist }}
|
{{- if $item | strings.HasPrefix "all-" }}{{ continue }}{{ end }}
|
||||||
|
{{- $filelist = $filelist | coll.Append $item }}
|
||||||
|
{{- end }}
|
||||||
|
{{- $last := sub (len $filelist) 1 }}
|
||||||
|
{{- range $i, $item := $filelist | coll.Sort }}
|
||||||
{{- if $item | strings.HasPrefix "all-" }}{{ continue }}{{ end }}
|
{{- if $item | strings.HasPrefix "all-" }}{{ continue }}{{ end }}
|
||||||
{{- if $i }},{{ end }}
|
|
||||||
{
|
{
|
||||||
"$ref": "https://gitea.rknet.org/infra/crds-catalog/raw/branch/catalog/{{ $path | path.Base }}/{{ $item }}"
|
"$ref": "https://gitea.rknet.org/infra/crds-catalog/raw/branch/catalog/{{ $path | path.Base }}/{{ $item }}"
|
||||||
}
|
}{{ if ne $i $last }},{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user