From 8b83e59971042f5fa8d7c02faf77637876498687 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 29 Jan 2017 22:01:26 -0200 Subject: [PATCH] fixed test --- pipeline/brew/brew_test.go | 3 ++- pipeline/fpm/fpm.go | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pipeline/brew/brew_test.go b/pipeline/brew/brew_test.go index f9dca51f8..e9ada50af 100644 --- a/pipeline/brew/brew_test.go +++ b/pipeline/brew/brew_test.go @@ -25,6 +25,7 @@ var defaultTemplateData = templateData{ Name: "Test", Repo: "caarlos0/test", Tag: "v0.1.3", + Version: "0.1.3", File: "test_Darwin_x86_64", SHA256: "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68", Format: "tar.gz", @@ -36,7 +37,7 @@ func assertDefaultTemplateData(t *testing.T, formulae string) { assert.Contains(formulae, "homepage \"https://google.com\"") assert.Contains(formulae, "url \"https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz\"") assert.Contains(formulae, "sha256 \"1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68\"") - assert.Contains(formulae, "version \"v0.1.3\"") + assert.Contains(formulae, "version \"0.1.3\"") assert.Contains(formulae, "bin.install \"test\"") } diff --git a/pipeline/fpm/fpm.go b/pipeline/fpm/fpm.go index e355c4a41..53f1639f3 100644 --- a/pipeline/fpm/fpm.go +++ b/pipeline/fpm/fpm.go @@ -7,9 +7,8 @@ import ( "os/exec" "path/filepath" - "golang.org/x/sync/errgroup" - "github.com/goreleaser/goreleaser/context" + "golang.org/x/sync/errgroup" ) var linuxArchives = []struct { @@ -39,14 +38,14 @@ func (Pipe) Description() string { // Run the pipe func (Pipe) Run(ctx *context.Context) error { + if len(ctx.Config.FPM.Formats) == 0 { + log.Println("No output formats configured, skipping") + return nil + } cmd := exec.Command("which", "fpm") if err := cmd.Run(); err != nil { return ErrNoFPM } - if len(ctx.Config.FPM.Formats) == 0 { - log.Println("No output formats configured") - return nil - } var g errgroup.Group for _, format := range ctx.Config.FPM.Formats { for _, archive := range linuxArchives {