fix: fix filelist in template (#83)
ci/woodpecker/push/build-package Pipeline was successful Details
ci/woodpecker/push/notify Pipeline was successful Details

Reviewed-on: #83
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-committed-by: Robert Kaussow <mail@thegeeklab.de>
This commit is contained in:
Robert Kaussow 2024-04-23 20:49:00 +02:00 committed by Robert Kaussow
parent 02784837fb
commit 316273c749
1 changed files with 8 additions and 5 deletions

View File

@ -1,14 +1,17 @@
{
"{{ ds "type" }}": [
{{- $path := ds "source" }}
{{- $filelist := file.ReadDir $path }}
{{- $length := len $filelist}}
{{- range $i, $item := $filelist }}
{{- $filelist := coll.Slice }}
{{- range $item := file.ReadDir $path }}
{{- 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 $i }},{{ end }}
{
"$ref": "https://gitea.rknet.org/infra/crds-catalog/raw/branch/catalog/{{ $path | path.Base }}/{{ $item }}"
}
}{{ if ne $i $last }},{{ end }}
{{- end }}
]
}