Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change default nfpm bindir #2910

Merged
merged 1 commit into from Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/pipe/nfpm/nfpm.go
Expand Up @@ -46,7 +46,7 @@ func (Pipe) Default(ctx *context.Context) error {
fpm.ID = "default"
}
if fpm.Bindir == "" {
fpm.Bindir = "/usr/local/bin"
fpm.Bindir = "/usr/bin"
}
if fpm.PackageName == "" {
fpm.PackageName = ctx.Config.ProjectName
Expand Down
6 changes: 3 additions & 3 deletions internal/pipe/nfpm/nfpm_test.go
Expand Up @@ -363,8 +363,8 @@ func TestInvalidTemplate(t *testing.T) {

t.Run("bindir", func(t *testing.T) {
ctx := makeCtx()
ctx.Config.NFPMs[0].Bindir = "/usr/local/{{ .NOPE }}"
require.Contains(t, Pipe{}.Run(ctx).Error(), `template: tmpl:1:14: executing "tmpl" at <.NOPE>: map has no entry for key "NOPE"`)
ctx.Config.NFPMs[0].Bindir = "/usr/{{ .NOPE }}"
require.Contains(t, Pipe{}.Run(ctx).Error(), `template: tmpl:1:8: executing "tmpl" at <.NOPE>: map has no entry for key "NOPE"`)
})
}

Expand Down Expand Up @@ -511,7 +511,7 @@ func TestDefault(t *testing.T) {
},
}
require.NoError(t, Pipe{}.Default(ctx))
require.Equal(t, "/usr/local/bin", ctx.Config.NFPMs[0].Bindir)
require.Equal(t, "/usr/bin", ctx.Config.NFPMs[0].Bindir)
require.Equal(t, []string{"foo", "bar"}, ctx.Config.NFPMs[0].Builds)
require.Equal(t, defaultNameTemplate, ctx.Config.NFPMs[0].FileNameTemplate)
require.Equal(t, ctx.Config.ProjectName, ctx.Config.NFPMs[0].PackageName)
Expand Down
2 changes: 1 addition & 1 deletion www/docs/customization/nfpm.md
Expand Up @@ -92,7 +92,7 @@ nfpms:
- fish

# Template to the path that the binaries should be installed.
# Defaults to `/usr/local/bin`.
# Defaults to `/usr/bin`.
bindir: /usr/bin

# Version Epoch.
Expand Down