From 588d8aa8ca516fd6cc833d86f523da598a837419 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Mon, 1 Aug 2022 16:14:50 -0300 Subject: [PATCH 1/3] fix: brew style closes #3236 Signed-off-by: Carlos A Becker --- internal/pipe/brew/template.go | 26 +++++++++---------- .../brew/testdata/TestFullFormulae.rb.golden | 8 +++--- .../TestFullPipe/custom_block.rb.golden | 12 ++++----- .../custom_download_strategy.rb.golden | 12 ++++----- .../TestFullPipe/custom_require.rb.golden | 12 ++++----- .../testdata/TestFullPipe/default.rb.golden | 12 ++++----- .../TestFullPipe/default_gitlab.rb.golden | 12 ++++----- .../valid_tap_templates.rb.golden | 12 ++++----- .../multiple_armv5.rb.golden | 12 ++++----- .../multiple_armv6.rb.golden | 12 ++++----- .../multiple_armv7.rb.golden | 12 ++++----- 11 files changed, 71 insertions(+), 71 deletions(-) diff --git a/internal/pipe/brew/template.go b/internal/pipe/brew/template.go index c66c26f7df7..a0ae2e0e217 100644 --- a/internal/pipe/brew/template.go +++ b/internal/pipe/brew/template.go @@ -45,6 +45,19 @@ class {{ .Name }} < Formula {{- if .License }} license "{{ .License }}" {{- end }} + {{- with .Dependencies }} + {{ range $index, $element := . }} + depends_on "{{ .Name }}" + {{- if .Type }} => :{{ .Type }}{{- end }} + {{- end }} + {{- end -}} + + {{- with .Conflicts }} + {{ range $index, $element := . }} + conflicts_with "{{ . }}" + {{- end }} + {{- end }} + {{- if and (not .LinuxPackages) .MacOSPackages }} depends_on :macos {{- end }} @@ -142,19 +155,6 @@ class {{ .Name }} < Formula {{- end }} {{- end }} - {{- with .Dependencies }} - {{ range $index, $element := . }} - depends_on "{{ .Name }}" - {{- if .Type }} => :{{ .Type }}{{- end }} - {{- end }} - {{- end -}} - - {{- with .Conflicts }} - {{ range $index, $element := . }} - conflicts_with "{{ . }}" - {{- end }} - {{- end }} - {{- with .PostInstall }} def post_install diff --git a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden index 3c995e35e87..78b50d6569a 100644 --- a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden @@ -8,6 +8,10 @@ class Test < Formula version "0.1.3" license "MIT" + depends_on "gtk+" + + conflicts_with "svn" + on_macos do if Hardware::CPU.intel? url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz" @@ -59,10 +63,6 @@ class Test < Formula sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68" end - depends_on "gtk+" - - conflicts_with "svn" - def post_install system "touch", "/tmp/foo" system "echo", "done" diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden index 87289275dd7..360fedf3423 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden @@ -6,6 +6,12 @@ class CustomBlock < Formula desc "A run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" + + conflicts_with "gtk+" + conflicts_with "qt" depends_on :macos on_macos do @@ -29,12 +35,6 @@ class CustomBlock < Formula head "https://github.com/caarlos0/test.git" - depends_on "zsh" => :optional - depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" - def post_install system "echo" system "touch" "/tmp/hi" diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden index 450351e5844..9d316d65a33 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden @@ -6,6 +6,12 @@ class CustomDownloadStrategy < Formula desc "A run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" + + conflicts_with "gtk+" + conflicts_with "qt" depends_on :macos on_macos do @@ -27,12 +33,6 @@ class CustomDownloadStrategy < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" - def post_install system "echo" system "touch" "/tmp/hi" diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden index baa5b40ebd3..163a6330e83 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden @@ -7,6 +7,12 @@ class CustomRequire < Formula desc "A run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" + + conflicts_with "gtk+" + conflicts_with "qt" depends_on :macos on_macos do @@ -28,12 +34,6 @@ class CustomRequire < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" - def post_install system "echo" system "touch" "/tmp/hi" diff --git a/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden index 8501ec49a97..fe89cfa70b6 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden @@ -6,6 +6,12 @@ class Default < Formula desc "A run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" + + conflicts_with "gtk+" + conflicts_with "qt" depends_on :macos on_macos do @@ -27,12 +33,6 @@ class Default < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" - def post_install system "echo" system "touch" "/tmp/hi" diff --git a/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden index 64378d0a108..6cbd5c00d3c 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden @@ -6,6 +6,12 @@ class DefaultGitlab < Formula desc "A run pipe test formula and FOO=foo_is_bar" homepage "https://gitlab.com/goreleaser" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" + + conflicts_with "gtk+" + conflicts_with "qt" depends_on :macos on_macos do @@ -27,12 +33,6 @@ class DefaultGitlab < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" - def post_install system "echo" system "touch" "/tmp/hi" diff --git a/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden index 69dd9e0f8ce..38093895626 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden @@ -6,6 +6,12 @@ class ValidTapTemplates < Formula desc "A run pipe test formula and FOO=templated" homepage "" version "1.0.1" + + depends_on "zsh" => :optional + depends_on "bash" + + conflicts_with "gtk+" + conflicts_with "qt" depends_on :macos on_macos do @@ -27,12 +33,6 @@ class ValidTapTemplates < Formula end end - depends_on "zsh" => :optional - depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" - def post_install system "echo" system "touch" "/tmp/hi" diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden index fe5df905a18..ec924dd7689 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden @@ -7,6 +7,12 @@ class MultipleArmv5 < Formula homepage "https://github.com/goreleaser" version "1.0.1" + depends_on "zsh" + depends_on "bash" => :recommended + + conflicts_with "gtk+" + conflicts_with "qt" + on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -45,12 +51,6 @@ class MultipleArmv5 < Formula end end - depends_on "zsh" - depends_on "bash" => :recommended - - conflicts_with "gtk+" - conflicts_with "qt" - def caveats; <<~EOS don't do this multiple_armv5 EOS diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden index 92bcf99d70f..bfe1191cbdb 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden @@ -7,6 +7,12 @@ class MultipleArmv6 < Formula homepage "https://github.com/goreleaser" version "1.0.1" + depends_on "zsh" + depends_on "bash" => :recommended + + conflicts_with "gtk+" + conflicts_with "qt" + on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -45,12 +51,6 @@ class MultipleArmv6 < Formula end end - depends_on "zsh" - depends_on "bash" => :recommended - - conflicts_with "gtk+" - conflicts_with "qt" - def caveats; <<~EOS don't do this multiple_armv6 EOS diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden index cbf3f0c5031..aeea743ec52 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden @@ -7,6 +7,12 @@ class MultipleArmv7 < Formula homepage "https://github.com/goreleaser" version "1.0.1" + depends_on "zsh" + depends_on "bash" => :recommended + + conflicts_with "gtk+" + conflicts_with "qt" + on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -45,12 +51,6 @@ class MultipleArmv7 < Formula end end - depends_on "zsh" - depends_on "bash" => :recommended - - conflicts_with "gtk+" - conflicts_with "qt" - def caveats; <<~EOS don't do this multiple_armv7 EOS From 51d7c1eac1c7592cecb4561669c36833d8a85710 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Thu, 4 Aug 2022 14:42:14 -0300 Subject: [PATCH 2/3] fix: more fixes Signed-off-by: Carlos A Becker --- internal/pipe/brew/brew_test.go | 42 ++++++++++++------- internal/pipe/brew/template.go | 36 ++++++++-------- .../brew/testdata/TestFullFormulae.rb.golden | 26 ++++++------ .../TestFullFormulaeMacOSOnly.rb.golden | 2 +- .../TestFullPipe/custom_block.rb.golden | 28 +++++++------ .../custom_download_strategy.rb.golden | 30 ++++++------- .../TestFullPipe/custom_require.rb.golden | 30 ++++++------- .../testdata/TestFullPipe/default.rb.golden | 28 +++++++------ .../TestFullPipe/default_gitlab.rb.golden | 28 +++++++------ .../valid_tap_templates.rb.golden | 28 +++++++------ .../TestRunPipeBinaryRelease.rb.golden | 4 +- .../v1.rb.golden | 5 ++- .../v2.rb.golden | 5 ++- .../v3.rb.golden | 5 ++- .../v4.rb.golden | 5 ++- .../multiple_armv5.rb.golden | 26 ++++++------ .../multiple_armv6.rb.golden | 26 ++++++------ .../multiple_armv7.rb.golden | 26 ++++++------ .../TestRunPipeNameTemplate.rb.golden | 5 ++- .../TestRunPipeUniversalBinary.rb.golden | 4 +- ...nPipeUniversalBinaryNotReplacing.rb.golden | 4 +- 21 files changed, 219 insertions(+), 174 deletions(-) diff --git a/internal/pipe/brew/brew_test.go b/internal/pipe/brew/brew_test.go index 62d6529d4b2..82ba88f1776 100644 --- a/internal/pipe/brew/brew_test.go +++ b/internal/pipe/brew/brew_test.go @@ -75,7 +75,7 @@ var defaultTemplateData = templateData{ }, { DownloadURL: "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz", - SHA256: "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd", + SHA256: "1df5fdc2bad4ed4c28fbdc77b6c542988c0dc0e2ae34e0dc912bbb1c66646c58", OS: "darwin", Arch: "arm64", Install: []string{`bin.install "test"`}, @@ -103,9 +103,9 @@ func TestFullFormulae(t *testing.T) { data.Dependencies = []config.HomebrewDependency{{Name: "gtk+"}} data.Conflicts = []string{"svn"} data.Plist = "it works" - data.PostInstall = []string{`system "touch", "/tmp/foo"`, `system "echo", "done"`} + data.PostInstall = []string{`touch "/tmp/foo"`, `system "echo", "done"`} data.CustomBlock = []string{"devel do", ` url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz"`, ` sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68"`, "end"} - data.Tests = []string{`system "#{bin}/{{.ProjectName}} -version"`} + data.Tests = []string{`system "#{bin}/{{.ProjectName}}\", \"-version"`} formulae, err := doBuildFormula(context.New(config.Project{ ProjectName: "foo", }), data) @@ -145,8 +145,8 @@ func TestFormulaeSimple(t *testing.T) { } func TestSplit(t *testing.T) { - parts := split("system \"true\"\nsystem \"#{bin}/foo -h\"") - require.Equal(t, []string{"system \"true\"", "system \"#{bin}/foo -h\""}, parts) + parts := split("system \"true\"\nsystem \"#{bin}/foo\", \"-h\"") + require.Equal(t, []string{"system \"true\"", "system \"#{bin}/foo\", \"-h\""}, parts) parts = split("") require.Equal(t, []string{}, parts) parts = split("\n ") @@ -268,14 +268,14 @@ func TestFullPipe(t *testing.T) { IDs: []string{ "foo", }, - Description: "A run pipe test formula and FOO={{ .Env.FOO }}", + Description: "Run pipe test formula and FOO={{ .Env.FOO }}", Caveats: "don't do this {{ .ProjectName }}", - Test: "system \"true\"\nsystem \"#{bin}/foo -h\"", + Test: "system \"true\"\nsystem \"#{bin}/foo\", \"-h\"", Plist: `whatever`, Dependencies: []config.HomebrewDependency{{Name: "zsh", Type: "optional"}, {Name: "bash"}}, Conflicts: []string{"gtk+", "qt"}, Service: "run foo/bar\nkeep_alive true", - PostInstall: "system \"echo\"\nsystem \"touch\" \"/tmp/hi\"", + PostInstall: "system \"echo\"\ntouch \"/tmp/hi\"", Install: `bin.install "{{ .ProjectName }}"`, Goamd64: "v1", }, @@ -353,8 +353,11 @@ func TestRunPipeNameTemplate(t *testing.T) { ProjectName: "foo", Brews: []config.Homebrew{ { - Name: "foo_{{ .Env.FOO_BAR }}", - Goamd64: "v1", + Name: "foo_{{ .Env.FOO_BAR }}", + Description: "Foo bar", + Homepage: "https://goreleaser.com", + Goamd64: "v1", + Install: "bin.install foo foo", Tap: config.RepoRef{ Owner: "foo", Name: "bar", @@ -524,12 +527,13 @@ func TestRunPipeForMultipleAmd64Versions(t *testing.T) { Brews: []config.Homebrew{ { Name: name, - Description: "A run pipe test formula", + Description: "Run pipe test formula", Tap: config.RepoRef{ Owner: "test", Name: "test", }, Homepage: "https://github.com/goreleaser", + Install: "bin.install foo foo", }, }, GitHubURLs: config.GitHubURLs{ @@ -648,9 +652,9 @@ func TestRunPipeForMultipleArmVersions(t *testing.T) { Brews: []config.Homebrew{ { Name: name, - Description: "A run pipe test formula and FOO={{ .Env.FOO }}", + Description: "Run pipe test formula and FOO={{ .Env.FOO }}", Caveats: "don't do this {{ .ProjectName }}", - Test: "system \"true\"\nsystem \"#{bin}/foo -h\"", + Test: "system \"true\"\nsystem \"#{bin}/foo\", \"-h\"", Plist: `whatever`, Dependencies: []config.HomebrewDependency{{Name: "zsh"}, {Name: "bash", Type: "recommended"}}, Conflicts: []string{"gtk+", "qt"}, @@ -921,7 +925,9 @@ func TestRunPipeBinaryRelease(t *testing.T) { ProjectName: "foo", Brews: []config.Homebrew{ { - Name: "foo", + Name: "foo", + Homepage: "https://goreleaser.com", + Description: "Fake desc", Tap: config.RepoRef{ Owner: "foo", Name: "bar", @@ -1159,7 +1165,9 @@ func TestRunPipeUniversalBinary(t *testing.T) { ProjectName: "unibin", Brews: []config.Homebrew{ { - Name: "unibin", + Name: "unibin", + Homepage: "https://goreleaser.com", + Description: "Fake desc", Tap: config.RepoRef{ Owner: "unibin", Name: "bar", @@ -1215,7 +1223,9 @@ func TestRunPipeUniversalBinaryNotReplacing(t *testing.T) { ProjectName: "unibin", Brews: []config.Homebrew{ { - Name: "unibin", + Name: "unibin", + Homepage: "https://goreleaser.com", + Description: "Fake desc", Tap: config.RepoRef{ Owner: "unibin", Name: "bar", diff --git a/internal/pipe/brew/template.go b/internal/pipe/brew/template.go index a0ae2e0e217..d78bba6a062 100644 --- a/internal/pipe/brew/template.go +++ b/internal/pipe/brew/template.go @@ -52,12 +52,6 @@ class {{ .Name }} < Formula {{- end }} {{- end -}} - {{- with .Conflicts }} - {{ range $index, $element := . }} - conflicts_with "{{ . }}" - {{- end }} - {{- end }} - {{- if and (not .LinuxPackages) .MacOSPackages }} depends_on :macos {{- end }} @@ -71,7 +65,7 @@ class {{ .Name }} < Formula {{- range $element := .MacOSPackages }} {{- if eq $element.Arch "all" }} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -81,7 +75,7 @@ class {{ .Name }} < Formula end {{- else if $.HasOnlyAmd64MacOsPkg }} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -107,7 +101,7 @@ class {{ .Name }} < Formula if Hardware::CPU.arm? {{- end}} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -136,7 +130,7 @@ class {{ .Name }} < Formula if Hardware::CPU.arm? && Hardware::CPU.is_64_bit? {{- end }} url "{{ $element.DownloadURL }}" - {{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }} + {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }} sha256 "{{ $element.SHA256 }}" def install @@ -149,6 +143,12 @@ class {{ .Name }} < Formula end {{- end }} + {{- with .Conflicts }} + {{ range $index, $element := . }} + conflicts_with "{{ . }}" + {{- end }} + {{- end }} + {{- with .CustomBlock }} {{ range $index, $element := . }} {{ . }} @@ -166,21 +166,23 @@ class {{ .Name }} < Formula {{- with .Caveats }} - def caveats; <<~EOS + def caveats + <<~EOS {{- range $index, $element := . }} - {{ . -}} + {{ . -}} {{- end }} - EOS + EOS end {{- end -}} {{- with .Plist }} - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - {{ . }} - EOS + def plist + <<~EOS + {{ . }} + EOS end {{- end -}} diff --git a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden index 78b50d6569a..f35dc82d01a 100644 --- a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden @@ -10,8 +10,6 @@ class Test < Formula depends_on "gtk+" - conflicts_with "svn" - on_macos do if Hardware::CPU.intel? url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz" @@ -23,7 +21,7 @@ class Test < Formula end if Hardware::CPU.arm? url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz" - sha256 "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd" + sha256 "1df5fdc2bad4ed4c28fbdc77b6c542988c0dc0e2ae34e0dc912bbb1c66646c58" def install bin.install "test" @@ -58,29 +56,33 @@ class Test < Formula end end + conflicts_with "svn" + devel do url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz" sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68" end def post_install - system "touch", "/tmp/foo" + touch "/tmp/foo" system "echo", "done" end - def caveats; <<~EOS - Here are some caveats - EOS + def caveats + <<~EOS + Here are some caveats + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - it works - EOS + def plist + <<~EOS + it works + EOS end test do - system "#{bin}/foo -version" + system "#{bin}/foo\", \"-version" end end diff --git a/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden b/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden index 942ec48535e..e5537ba074e 100644 --- a/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulaeMacOSOnly.rb.golden @@ -19,7 +19,7 @@ class Test < Formula end if Hardware::CPU.arm? url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_arm64.tar.gz" - sha256 "1633f61598ab0791e213135923624eb342196b349490sadasdsadsadasdasdsd" + sha256 "1df5fdc2bad4ed4c28fbdc77b6c542988c0dc0e2ae34e0dc912bbb1c66646c58" def install bin.install "test" diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden index 360fedf3423..0ead5913588 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_block.rb.golden @@ -3,15 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class CustomBlock < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" depends_on "zsh" => :optional depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" depends_on :macos on_macos do @@ -33,23 +30,28 @@ class CustomBlock < Formula end end + conflicts_with "gtk+" + conflicts_with "qt" + head "https://github.com/caarlos0/test.git" def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this custom_block - EOS + def caveats + <<~EOS + don't do this custom_block + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -59,6 +61,6 @@ class CustomBlock < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden index 9d316d65a33..b70ac164fd4 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_download_strategy.rb.golden @@ -3,19 +3,16 @@ # This file was generated by GoReleaser. DO NOT EDIT. class CustomDownloadStrategy < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" depends_on "zsh" => :optional depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" depends_on :macos on_macos do - url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy + url "https://dummyhost/download/v1.0.1/bin.tar.gz", using: GitHubPrivateRepositoryReleaseDownloadStrategy sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install @@ -33,21 +30,26 @@ class CustomDownloadStrategy < Formula end end + conflicts_with "gtk+" + conflicts_with "qt" + def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this custom_download_strategy - EOS + def caveats + <<~EOS + don't do this custom_download_strategy + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class CustomDownloadStrategy < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden index 163a6330e83..8268f1cb7f1 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/custom_require.rb.golden @@ -4,19 +4,16 @@ # This file was generated by GoReleaser. DO NOT EDIT. require_relative "custom_download_strategy" class CustomRequire < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" depends_on "zsh" => :optional depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" depends_on :macos on_macos do - url "https://dummyhost/download/v1.0.1/bin.tar.gz", :using => CustomDownloadStrategy + url "https://dummyhost/download/v1.0.1/bin.tar.gz", using: CustomDownloadStrategy sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install @@ -34,21 +31,26 @@ class CustomRequire < Formula end end + conflicts_with "gtk+" + conflicts_with "qt" + def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this custom_require - EOS + def caveats + <<~EOS + don't do this custom_require + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -58,6 +60,6 @@ class CustomRequire < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden index fe89cfa70b6..98000a4eee9 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/default.rb.golden @@ -3,15 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Default < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" depends_on "zsh" => :optional depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" depends_on :macos on_macos do @@ -33,21 +30,26 @@ class Default < Formula end end + conflicts_with "gtk+" + conflicts_with "qt" + def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this default - EOS + def caveats + <<~EOS + don't do this default + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class Default < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden index 6cbd5c00d3c..f3b8a28e4ea 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/default_gitlab.rb.golden @@ -3,15 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class DefaultGitlab < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://gitlab.com/goreleaser" version "1.0.1" depends_on "zsh" => :optional depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" depends_on :macos on_macos do @@ -33,21 +30,26 @@ class DefaultGitlab < Formula end end + conflicts_with "gtk+" + conflicts_with "qt" + def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this default_gitlab - EOS + def caveats + <<~EOS + don't do this default_gitlab + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class DefaultGitlab < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden b/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden index 38093895626..787b5440aaf 100644 --- a/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden +++ b/internal/pipe/brew/testdata/TestFullPipe/valid_tap_templates.rb.golden @@ -3,15 +3,12 @@ # This file was generated by GoReleaser. DO NOT EDIT. class ValidTapTemplates < Formula - desc "A run pipe test formula and FOO=templated" + desc "Run pipe test formula and FOO=templated" homepage "" version "1.0.1" depends_on "zsh" => :optional depends_on "bash" - - conflicts_with "gtk+" - conflicts_with "qt" depends_on :macos on_macos do @@ -33,21 +30,26 @@ class ValidTapTemplates < Formula end end + conflicts_with "gtk+" + conflicts_with "qt" + def post_install system "echo" - system "touch" "/tmp/hi" + touch "/tmp/hi" end - def caveats; <<~EOS - don't do this valid_tap_templates - EOS + def caveats + <<~EOS + don't do this valid_tap_templates + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end service do @@ -57,6 +59,6 @@ class ValidTapTemplates < Formula test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden b/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden index c9e8520a35e..7d6d4e319e9 100644 --- a/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeBinaryRelease.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Foo < Formula - desc "" - homepage "" + desc "Fake desc" + homepage "https://goreleaser.com" version "1.2.1" depends_on :macos diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden index 4740f9beb76..842cd6f708b 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V1 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end @@ -23,6 +24,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden index 278d117186b..c360a725791 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V2 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end @@ -23,6 +24,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden index ee702693ee3..301fd5b4f3b 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V3 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end @@ -23,6 +24,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden index eb3d02c7200..80e761301ba 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden @@ -3,7 +3,7 @@ # This file was generated by GoReleaser. DO NOT EDIT. class V4 < Formula - desc "A run pipe test formula" + desc "Run pipe test formula" homepage "https://github.com/goreleaser" version "1.0.1" @@ -13,6 +13,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end @@ -23,6 +24,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end if Hardware::CPU.intel? @@ -30,6 +32,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden index ec924dd7689..1cd003ca3d0 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv5.rb.golden @@ -3,16 +3,13 @@ # This file was generated by GoReleaser. DO NOT EDIT. class MultipleArmv5 < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" depends_on "zsh" depends_on "bash" => :recommended - conflicts_with "gtk+" - conflicts_with "qt" - on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -51,20 +48,25 @@ class MultipleArmv5 < Formula end end - def caveats; <<~EOS - don't do this multiple_armv5 - EOS + conflicts_with "gtk+" + conflicts_with "qt" + + def caveats + <<~EOS + don't do this multiple_armv5 + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden index bfe1191cbdb..b60fe0a4b53 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv6.rb.golden @@ -3,16 +3,13 @@ # This file was generated by GoReleaser. DO NOT EDIT. class MultipleArmv6 < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" depends_on "zsh" depends_on "bash" => :recommended - conflicts_with "gtk+" - conflicts_with "qt" - on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -51,20 +48,25 @@ class MultipleArmv6 < Formula end end - def caveats; <<~EOS - don't do this multiple_armv6 - EOS + conflicts_with "gtk+" + conflicts_with "qt" + + def caveats + <<~EOS + don't do this multiple_armv6 + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden index aeea743ec52..d9ba71317ee 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleArmVersions/multiple_armv7.rb.golden @@ -3,16 +3,13 @@ # This file was generated by GoReleaser. DO NOT EDIT. class MultipleArmv7 < Formula - desc "A run pipe test formula and FOO=foo_is_bar" + desc "Run pipe test formula and FOO=foo_is_bar" homepage "https://github.com/goreleaser" version "1.0.1" depends_on "zsh" depends_on "bash" => :recommended - conflicts_with "gtk+" - conflicts_with "qt" - on_macos do url "https://dummyhost/download/v1.0.1/bin.tar.gz" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" @@ -51,20 +48,25 @@ class MultipleArmv7 < Formula end end - def caveats; <<~EOS - don't do this multiple_armv7 - EOS + conflicts_with "gtk+" + conflicts_with "qt" + + def caveats + <<~EOS + don't do this multiple_armv7 + EOS end - plist_options :startup => false + plist_options startup: false - def plist; <<~EOS - whatever - EOS + def plist + <<~EOS + whatever + EOS end test do system "true" - system "#{bin}/foo -h" + system "#{bin}/foo", "-h" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden index 6199ba13517..94f5f1d5458 100644 --- a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class FooIsBar < Formula - desc "" - homepage "" + desc "Foo bar" + homepage "https://goreleaser.com" version "1.0.1" depends_on :macos @@ -13,6 +13,7 @@ class FooIsBar < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install + bin.install foo foo end if Hardware::CPU.arm? diff --git a/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden b/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden index cee06cb021b..3a599fc9073 100644 --- a/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeUniversalBinary.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Unibin < Formula - desc "" - homepage "" + desc "Fake desc" + homepage "https://goreleaser.com" version "1.0.1" depends_on :macos diff --git a/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden b/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden index 563173ca5ed..f17ace78f1d 100644 --- a/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeUniversalBinaryNotReplacing.rb.golden @@ -3,8 +3,8 @@ # This file was generated by GoReleaser. DO NOT EDIT. class Unibin < Formula - desc "" - homepage "" + desc "Fake desc" + homepage "https://goreleaser.com" version "1.0.1" depends_on :macos From 686027076b7c98eebeea7647b5e3a2aa328ce17f Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Thu, 4 Aug 2022 14:47:21 -0300 Subject: [PATCH 3/3] fix: more fixes Signed-off-by: Carlos A Becker --- internal/pipe/brew/brew_test.go | 6 +++--- internal/pipe/brew/testdata/TestFullFormulae.rb.golden | 2 +- .../TestRunPipeForMultipleAmd64Versions/v1.rb.golden | 6 +++--- .../TestRunPipeForMultipleAmd64Versions/v2.rb.golden | 6 +++--- .../TestRunPipeForMultipleAmd64Versions/v3.rb.golden | 6 +++--- .../TestRunPipeForMultipleAmd64Versions/v4.rb.golden | 6 +++--- .../pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/internal/pipe/brew/brew_test.go b/internal/pipe/brew/brew_test.go index 82ba88f1776..5ceb02948bd 100644 --- a/internal/pipe/brew/brew_test.go +++ b/internal/pipe/brew/brew_test.go @@ -105,7 +105,7 @@ func TestFullFormulae(t *testing.T) { data.Plist = "it works" data.PostInstall = []string{`touch "/tmp/foo"`, `system "echo", "done"`} data.CustomBlock = []string{"devel do", ` url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz"`, ` sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68"`, "end"} - data.Tests = []string{`system "#{bin}/{{.ProjectName}}\", \"-version"`} + data.Tests = []string{`system "#{bin}/{{.ProjectName}}", "-version"`} formulae, err := doBuildFormula(context.New(config.Project{ ProjectName: "foo", }), data) @@ -357,7 +357,7 @@ func TestRunPipeNameTemplate(t *testing.T) { Description: "Foo bar", Homepage: "https://goreleaser.com", Goamd64: "v1", - Install: "bin.install foo foo", + Install: `bin.install "foo"`, Tap: config.RepoRef{ Owner: "foo", Name: "bar", @@ -533,7 +533,7 @@ func TestRunPipeForMultipleAmd64Versions(t *testing.T) { Name: "test", }, Homepage: "https://github.com/goreleaser", - Install: "bin.install foo foo", + Install: `bin.install "foo"`, }, }, GitHubURLs: config.GitHubURLs{ diff --git a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden index f35dc82d01a..90bdb960dc5 100644 --- a/internal/pipe/brew/testdata/TestFullFormulae.rb.golden +++ b/internal/pipe/brew/testdata/TestFullFormulae.rb.golden @@ -83,6 +83,6 @@ class Test < Formula end test do - system "#{bin}/foo\", \"-version" + system "#{bin}/foo", "-version" end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden index 842cd6f708b..0f84661f49d 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v1.rb.golden @@ -13,7 +13,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end @@ -24,7 +24,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end if Hardware::CPU.intel? @@ -32,7 +32,7 @@ class V1 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden index c360a725791..eb0a2b01df7 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v2.rb.golden @@ -13,7 +13,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end @@ -24,7 +24,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end if Hardware::CPU.intel? @@ -32,7 +32,7 @@ class V2 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden index 301fd5b4f3b..da36695b082 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v3.rb.golden @@ -13,7 +13,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end @@ -24,7 +24,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end if Hardware::CPU.intel? @@ -32,7 +32,7 @@ class V3 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden index 80e761301ba..eba025403e4 100644 --- a/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeForMultipleAmd64Versions/v4.rb.golden @@ -13,7 +13,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end @@ -24,7 +24,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end if Hardware::CPU.intel? @@ -32,7 +32,7 @@ class V4 < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end end end diff --git a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden index 94f5f1d5458..8d43aaf7e02 100644 --- a/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden +++ b/internal/pipe/brew/testdata/TestRunPipeNameTemplate.rb.golden @@ -13,7 +13,7 @@ class FooIsBar < Formula sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" def install - bin.install foo foo + bin.install "foo" end if Hardware::CPU.arm?