1
1
Fork 0
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:
Kyle Penfound 2021-10-10 13:44:47 -04:00 committed by GitHub
parent d43e819f62
commit 4210500f66
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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)
}

View File

@ -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),
},
}