1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

fix: improve check/load config logs

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2023-08-18 21:45:58 +00:00
parent d9b8e0f7f7
commit da380cc9a7
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
3 changed files with 7 additions and 6 deletions

View File

@ -47,7 +47,9 @@ func newCheckCmd() *checkCmd {
ctx.Deprecated = root.deprecated
if err := ctrlc.Default.Run(ctx, func() error {
log.Info(boldStyle.Render("checking configuration..."))
log.WithField("path", config).
Info(boldStyle.Render("checking"))
return defaults.Pipe{}.Run(ctx)
}); err != nil {
log.WithError(err).Error(boldStyle.Render("configuration is invalid"))

View File

@ -11,13 +11,15 @@ import (
)
func loadConfig(path string) (config.Project, error) {
p, _, err := loadConfigCheck(path)
p, path, err := loadConfigCheck(path)
if err == nil {
log.WithField("path", path).Info("loading")
}
return p, err
}
func loadConfigCheck(path string) (config.Project, string, error) {
if path == "-" {
log.Info("loading config from stdin")
p, err := config.LoadReader(os.Stdin)
return p, path, err
}

View File

@ -11,7 +11,6 @@ import (
"strings"
"time"
"github.com/caarlos0/log"
"github.com/goreleaser/goreleaser/internal/yaml"
"github.com/goreleaser/nfpm/v2/files"
"github.com/invopop/jsonschema"
@ -1330,7 +1329,6 @@ func Load(file string) (config Project, err error) {
return
}
defer f.Close()
log.WithField("file", file).Info("loading config file")
return LoadReader(f)
}
@ -1341,7 +1339,6 @@ func LoadReader(fd io.Reader) (config Project, err error) {
return config, err
}
err = yaml.UnmarshalStrict(data, &config)
log.WithField("config", config).Debug("loaded config file")
return config, err
}