Update update_appindex.go
This commit is contained in:
parent
d4ad91a85d
commit
a27d2e4083
1 changed files with 4 additions and 1 deletions
|
@ -214,7 +214,6 @@ func removeExistingEntry(name, release, arch, origin, platform string) {
|
|||
if inEntry && len(currentEntry) > 0 {
|
||||
if !(pVal == name && rVal == release && aVal == arch && oVal == origin && plVal == platform) {
|
||||
newLines = append(newLines, currentEntry...)
|
||||
newLines = append(newLines, "") // optional blank line
|
||||
}
|
||||
}
|
||||
// Start a new entry
|
||||
|
@ -252,7 +251,11 @@ func removeExistingEntry(name, release, arch, origin, platform string) {
|
|||
}
|
||||
}
|
||||
|
||||
// Join and collapse multiple newlines into one
|
||||
finalContent := strings.Join(newLines, "\n")
|
||||
re := regexp.MustCompile(`\n+`)
|
||||
finalContent = re.ReplaceAllString(finalContent, "\n")
|
||||
|
||||
if !strings.HasSuffix(finalContent, "\n") {
|
||||
finalContent += "\n"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue