Skip to content

Commit

Permalink
fix: remove semver parsing code before schema version detection (#333)
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
dmuntean and caarlos0 authored May 3, 2021
1 parent 7b9b0c4 commit 5c1976b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions nfpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,19 +390,6 @@ func WithDefaults(info *Info) *Info {
info.Version = "v0.0.0-rc0"
}

// parse the version as a semver so we can properly split the parts
// and support proper ordering for both rpm and deb
if v, err := semver.NewVersion(info.Version); err == nil {
info.Version = fmt.Sprintf("%d.%d.%d", v.Major(), v.Minor(), v.Patch())
if info.Prerelease == "" {
info.Prerelease = v.Prerelease()
}

if info.VersionMetadata == "" {
info.VersionMetadata = v.Metadata()
}
}

switch info.VersionSchema {
case "none":
// No change to the version or prerelease info set in the YAML file
Expand Down

1 comment on commit 5c1976b

@vercel
Copy link

@vercel vercel bot commented on 5c1976b May 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.