Skip to content

Commit

Permalink
fix(apk): alpine conventional file name (#725)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Oct 14, 2023
1 parent 07ca006 commit a2d723a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apk/apk.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ func (a *Apk) ConventionalFileName(info *nfpm.Info) string {
version := info.Version

if info.Prerelease != "" {
version += "" + info.Prerelease
version += "_" + info.Prerelease
}

if info.Release != "" {
version += "-" + info.Release
version += "_p" + info.Release
}

return fmt.Sprintf("%s_%s_%s.apk", info.Name, version, info.Arch)
Expand Down
8 changes: 4 additions & 4 deletions apk/apk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,19 +478,19 @@ func TestAPKConventionalFileName(t *testing.T) {
},
{
Arch: "386", Version: "1.2.3", Prerelease: "git",
Expect: "default_1.2.3git_x86.apk",
Expect: "default_1.2.3_git_x86.apk",
},
{
Arch: "386", Version: "1.2.3", Prerelease: "git", Release: "1",
Expect: "default_1.2.3git-1_x86.apk",
Expect: "default_1.2.3_git_p1_x86.apk",
},
{
Arch: "all", Version: "1.2.3",
Expect: "default_1.2.3_all.apk",
},
{
Arch: "386", Version: "1.2.3", Release: "1", Prerelease: "beta",
Expect: "default_1.2.3beta-1_x86.apk",
Arch: "386", Version: "1.2.3", Release: "1", Prerelease: "beta1",
Expect: "default_1.2.3_beta1_p1_x86.apk",
},
}

Expand Down

0 comments on commit a2d723a

Please sign in to comment.