1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-09-16 09:26:52 +02:00

fix: tests should pass now

Make the code more safe
This commit is contained in:
Carlos Alexandro Becker
2017-12-08 21:34:44 -02:00
committed by Carlos Alexandro Becker
parent 29d9ae5878
commit 5636313d7c
2 changed files with 13 additions and 6 deletions

View File

@@ -27,6 +27,15 @@ import (
yaml "gopkg.in/yaml.v2"
)
var (
normalPadding = cli.Default.Padding
increasedPadding = normalPadding * 2
)
func init() {
log.SetHandler(cli.Default)
}
var pipes = []pipeline.Piper{
defaults.Pipe{}, // load default configs
git.Pipe{}, // get and validate git repo state
@@ -89,17 +98,15 @@ func Release(flags Flags) error {
ctx.Publish = false
}
ctx.RmDist = flags.Bool("rm-dist")
logger, _ := log.Log.(*log.Logger)
handler, _ := logger.Handler.(*cli.Handler)
for _, pipe := range pipes {
handler.Padding = 3
cli.Default.Padding = normalPadding
log.Infof("\033[1m%s\033[0m", strings.ToUpper(pipe.String()))
handler.Padding = 6
cli.Default.Padding = increasedPadding
if err := handle(pipe.Run(ctx)); err != nil {
return err
}
}
handler.Padding = 3
cli.Default.Padding = normalPadding
return nil
}

View File

@@ -18,7 +18,7 @@ var (
)
func init() {
log.SetHandler(lcli.New(os.Stdout))
log.SetHandler(lcli.Default)
}
func main() {