Fix regexp for AddedExtractor (#284)

Co-authored-by: mariom <11mariom@gmail.com>
pull/258/merge
Mariusz Kozakowski 2 years ago committed by GitHub
parent 046331748c
commit 1512db5b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,9 +14,9 @@ func (e addedExtractor) Matches(line string) bool {
}
func (e addedExtractor) Extract(metadata *BackupLogMetadata, line string) {
// Sample line: "Added to the repo: 0 B"
metadata.AddedSize = strings.TrimSpace(e.re.ReplaceAllString(line, ""))
metadata.AddedSize = strings.TrimSpace(e.re.ReplaceAllString(line, "$2"))
}
func NewAddedExtractor() MetadatExtractor {
return addedExtractor{regexp.MustCompile(`(?i)^Added to the repo:`)}
return addedExtractor{regexp.MustCompile(`(?i)^Added to the repo(sitory)?: ([\d\.]+ \w+)( \([\d\.]+[\w\s]+\))?`)}
}

Loading…
Cancel
Save