mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fix(archive): warn only for non-default globs with no matches (#4013)
Adjust the logging of warnings for unmatched globs to only show when the glob is not a default. No warning will be output for the default globs when there are no matching files. These are defaults, by design, very generic. We should not warn the user about them not finding anything, as that is their expected behavior most of the time.
This commit is contained in:
parent
234e1d8ce5
commit
b5e8d6db06
@ -31,7 +31,11 @@ func Eval(template *tmpl.Template, rlcp bool, files []config.File) ([]config.Fil
|
||||
}
|
||||
|
||||
if len(files) == 0 {
|
||||
log.WithField("glob", f.Source).Warn("no files matched")
|
||||
if !f.Default {
|
||||
// only log if its not a default glob, as those are usually
|
||||
// very generic and are not really warnings for the user.
|
||||
log.WithField("glob", f.Source).Warn("no files matched")
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -64,12 +64,12 @@ func (Pipe) Default(ctx *context.Context) error {
|
||||
}
|
||||
if len(archive.Files) == 0 {
|
||||
archive.Files = []config.File{
|
||||
{Source: "license*"},
|
||||
{Source: "LICENSE*"},
|
||||
{Source: "readme*"},
|
||||
{Source: "README*"},
|
||||
{Source: "changelog*"},
|
||||
{Source: "CHANGELOG*"},
|
||||
{Source: "license*", Default: true},
|
||||
{Source: "LICENSE*", Default: true},
|
||||
{Source: "readme*", Default: true},
|
||||
{Source: "README*", Default: true},
|
||||
{Source: "changelog*", Default: true},
|
||||
{Source: "CHANGELOG*", Default: true},
|
||||
}
|
||||
}
|
||||
if archive.NameTemplate == "" {
|
||||
|
@ -464,6 +464,7 @@ type File struct {
|
||||
Destination string `yaml:"dst,omitempty" json:"dst,omitempty"`
|
||||
StripParent bool `yaml:"strip_parent,omitempty" json:"strip_parent,omitempty"`
|
||||
Info FileInfo `yaml:"info,omitempty" json:"info,omitempty"`
|
||||
Default bool `yaml:"-" json:"-"`
|
||||
}
|
||||
|
||||
// FileInfo is the file info of a file.
|
||||
|
Loading…
x
Reference in New Issue
Block a user