1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-11-06 09:09:29 +02:00

fix: update strings when using a custom distribution directory (#2689)

Signed-off-by: Carlos Panato <ctadeu@gmail.com>
This commit is contained in:
Carlos Tadeu Panato Junior
2021-11-23 13:25:15 +01:00
committed by GitHub
parent 808b603506
commit ff0fdf3520

View File

@@ -14,14 +14,14 @@ import (
type Pipe struct{} type Pipe struct{}
func (Pipe) String() string { func (Pipe) String() string {
return "checking ./dist" return "checking distribution directory"
} }
// Run the pipe. // Run the pipe.
func (Pipe) Run(ctx *context.Context) (err error) { func (Pipe) Run(ctx *context.Context) (err error) {
_, err = os.Stat(ctx.Config.Dist) _, err = os.Stat(ctx.Config.Dist)
if os.IsNotExist(err) { if os.IsNotExist(err) {
log.Debug("./dist doesn't exist, creating empty folder") log.Debugf("%s doesn't exist, creating empty folder", ctx.Config.Dist)
return mkdir(ctx) return mkdir(ctx)
} }
if ctx.RmDist { if ctx.RmDist {
@@ -37,13 +37,13 @@ func (Pipe) Run(ctx *context.Context) (err error) {
return return
} }
if len(files) != 0 { if len(files) != 0 {
log.Debugf("there are %d files on ./dist", len(files)) log.Debugf("there are %d files on %s", len(files), ctx.Config.Dist)
return fmt.Errorf( return fmt.Errorf(
"%s is not empty, remove it before running goreleaser or use the --rm-dist flag", "%s is not empty, remove it before running goreleaser or use the --rm-dist flag",
ctx.Config.Dist, ctx.Config.Dist,
) )
} }
log.Debug("./dist is empty") log.Debugf("%s is empty", ctx.Config.Dist)
return mkdir(ctx) return mkdir(ctx)
} }