mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
fix: filter out empty updaters in input (#235)
This commit is contained in:
parent
f1aa1a2ef4
commit
5306e2dd35
2 changed files with 9 additions and 0 deletions
|
|
@ -135,6 +135,10 @@ func parseUpdaters(input []string) []string {
|
||||||
names := []string{"changelog", "generic"}
|
names := []string{"changelog", "generic"}
|
||||||
|
|
||||||
for _, u := range input {
|
for _, u := range input {
|
||||||
|
if u == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(u, "-") {
|
if strings.HasPrefix(u, "-") {
|
||||||
name := u[1:]
|
name := u[1:]
|
||||||
names = slices.DeleteFunc(names, func(existingName string) bool { return existingName == name })
|
names = slices.DeleteFunc(names, func(existingName string) bool { return existingName == name })
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,11 @@ func Test_parseUpdaters(t *testing.T) {
|
||||||
input: []string{"bar", "bar", "changelog"},
|
input: []string{"bar", "bar", "changelog"},
|
||||||
want: []string{"bar", "changelog", "generic"},
|
want: []string{"bar", "changelog", "generic"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "remove empty entries",
|
||||||
|
input: []string{""},
|
||||||
|
want: []string{"changelog", "generic"},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue