Skip to content

Commit

Permalink
fix: nfpm id
Browse files Browse the repository at this point in the history
refs #1357

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Feb 27, 2020
1 parent 61fb8f5 commit ad94dbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/pipe/nfpm/nfpm.go
Expand Up @@ -206,6 +206,7 @@ func create(ctx *context.Context, fpm config.NFPM, format, arch string, binaries
Goarm: binaries[0].Goarm,
Extra: map[string]interface{}{
"Builds": binaries,
"ID": fpm.ID,
},
})
return nil
Expand Down
2 changes: 2 additions & 0 deletions internal/pipe/nfpm/nfpm_test.go
Expand Up @@ -86,6 +86,7 @@ func TestRunPipe(t *testing.T) {
Dist: dist,
NFPMs: []config.NFPM{
{
ID: "someid",
Bindir: "/usr/bin",
Builds: []string{"default"},
Formats: []string{"deb", "rpm"},
Expand Down Expand Up @@ -143,6 +144,7 @@ func TestRunPipe(t *testing.T) {
require.Len(t, packages, 4)
for _, pkg := range packages {
require.Contains(t, pkg.Name, "mybin_1.0.0_Tux_", "linux should have been replaced by Tux")
require.Equal(t, pkg.ExtraOr("ID", ""), "someid")
}
require.Len(t, ctx.Config.NFPMs[0].Files, 1, "should not modify the config file list")
}
Expand Down

0 comments on commit ad94dbc

Please sign in to comment.