Skip to content

Commit

Permalink
fix: trim suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
afdesk committed Aug 22, 2024
1 parent 3a45502 commit e796df2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/dependency/parser/python/pip/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func (p *Parser) Parse(r xio.ReadSeekerAt) ([]ftypes.Package, []ftypes.Dependenc
if len(s) != 2 {
continue
}
if p.useMinVersion {
s[1] = strings.Replace(s[1], "*", "0", 1)
if p.useMinVersion && strings.HasSuffix(s[1], ".*") {
s[1] = strings.TrimSuffix(s[1], "*") + "0"
}

if !isValidName(s[0]) || !isValidVersion(s[1]) {
Expand Down

0 comments on commit e796df2

Please sign in to comment.