mirror of
https://github.com/goreleaser/nfpm
synced 2024-05-27 00:36:10 +02:00
fix: release at end of version string (#375)
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
parent
d43e819f62
commit
4210500f66
|
@ -61,10 +61,6 @@ func (*Deb) ConventionalFileName(info *nfpm.Info) string {
|
|||
}
|
||||
|
||||
version := info.Version
|
||||
if info.Release != "" {
|
||||
version += "-" + info.Release
|
||||
}
|
||||
|
||||
if info.Prerelease != "" {
|
||||
version += "~" + info.Prerelease
|
||||
}
|
||||
|
@ -73,6 +69,10 @@ func (*Deb) ConventionalFileName(info *nfpm.Info) string {
|
|||
version += "+" + info.VersionMetadata
|
||||
}
|
||||
|
||||
if info.Release != "" {
|
||||
version += "-" + info.Release
|
||||
}
|
||||
|
||||
// package_version_architecture.package-type
|
||||
return fmt.Sprintf("%s_%s_%s.deb", info.Name, version, arch)
|
||||
}
|
||||
|
|
|
@ -477,7 +477,7 @@ func TestDEBConventionalFileName(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Version: "1.2.3", Release: "4", Prerelease: "5", Metadata: "",
|
||||
Expected: fmt.Sprintf("%s_1.2.3-4~5_%s.deb", info.Name, info.Arch),
|
||||
Expected: fmt.Sprintf("%s_1.2.3~5-4_%s.deb", info.Name, info.Arch),
|
||||
},
|
||||
{
|
||||
Version: "1.2.3", Release: "", Prerelease: "5", Metadata: "",
|
||||
|
@ -485,7 +485,7 @@ func TestDEBConventionalFileName(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Version: "1.2.3", Release: "1", Prerelease: "5", Metadata: "git",
|
||||
Expected: fmt.Sprintf("%s_1.2.3-1~5+git_%s.deb", info.Name, info.Arch),
|
||||
Expected: fmt.Sprintf("%s_1.2.3~5+git-1_%s.deb", info.Name, info.Arch),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue