Skip to content

Commit

Permalink
Fix regexp for AddedExtractor (cupcakearmy#284)
Browse files Browse the repository at this point in the history
Co-authored-by: mariom <[email protected]>
  • Loading branch information
11mariom and 11mariom committed Jan 18, 2023
1 parent 0463317 commit 1512db5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/metadata/extractor_added.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]+\))?`)}
}

0 comments on commit 1512db5

Please sign in to comment.