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

fix: homebrew spacing in the formula

This commit is contained in:
Carlos Alexandro Becker 2018-04-01 15:07:28 -03:00 committed by Carlos Alexandro Becker
parent ff867876b4
commit ecce86f121
12 changed files with 18 additions and 159 deletions

View File

@ -44,7 +44,6 @@ type Homebrew struct {
Dependencies []string `yaml:",omitempty"`
BuildDependencies []string `yaml:"build_dependencies,omitempty"`
Test string `yaml:",omitempty"`
Special string `yaml:",omitempty"`
Conflicts []string `yaml:",omitempty"`
Description string `yaml:",omitempty"`
Homepage string `yaml:",omitempty"`

View File

@ -83,12 +83,6 @@ brew:
system "#{bin}/program --version"
...
# Specify any additional formula content in the special section.
# Default is empty.
special: |
system "make completion"
...
# Custom install script for brew.
# Default is 'bin.install "program"'.
install: |

View File

@ -181,7 +181,6 @@ func dataFor(ctx *context.Context, client client.Client, artifact artifact.Artif
Plist: cfg.Plist,
Install: split(cfg.Install),
Tests: split(cfg.Test),
Special: split(cfg.Special),
DownloadStrategy: cfg.DownloadStrategy,
}, nil
}

View File

@ -20,31 +20,29 @@ type templateData struct {
BuildDependencies []string
Conflicts []string
Tests []string
Special []string
}
const formulaTemplate = `class {{ .Name }} < Formula
desc "{{ .Desc }}"
homepage "{{ .Homepage }}"
{{- if .BuildDependencies }}
{{ if .BuildDependencies -}}
url "{{ .DownloadURL }}/{{ .Repo.Owner }}/{{ .Repo.Name }}/archive/{{ .Tag }}.tar.gz"
{{ else }}
head "https://github.com/{{ .Repo.Owner }}/{{ .Repo.Name }}.git"
{{- else -}}
url "{{ .DownloadURL }}/{{ .Repo.Owner }}/{{ .Repo.Name }}/releases/download/{{ .Tag }}/{{ .File }}"
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
{{- end }}
version "{{ .Version }}"
sha256 "{{ .SHA256 }}"
head "https://github.com/{{ .Repo.Owner }}/{{ .Repo.Name }}.git"
{{- with .BuildDependencies }}
{{ range $index, $element := . }}
depends_on "{{ . }}" => :build
{{ with .Dependencies -}}
{{ range $index, $element := . -}}
depends_on "{{ . }}"
{{- end }}
{{- end -}}
{{- with .Dependencies }}
{{- with .BuildDependencies -}}
{{ range $index, $element := . }}
depends_on "{{ . }}"
depends_on "{{ . }}" => :build
{{- end }}
{{- end -}}
@ -54,12 +52,6 @@ const formulaTemplate = `class {{ .Name }} < Formula
{{- end }}
{{- end }}
{{- with .Special }}
{{- range $index, $element := . }}
{{ . -}}
{{- end -}}
{{- end }}
def install
{{- range $index, $element := .Install }}
{{ . -}}

View File

@ -1,39 +0,0 @@
class BuildFromSource < Formula
desc "A run pipe test formula"
homepage "https://github.com/goreleaser"
url "https://github.com/test/test/archive/v1.0.1.tar.gz"
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
head "https://github.com/test/test.git"
depends_on "go" => :build
depends_on "zsh"
depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"
end
def caveats; <<-EOS.undent
don't do this
EOS
end
plist_options :startup => false
def plist; <<~EOS
<xml>whatever</xml>
EOS
end
test do
system "true"
system "#{bin}/foo -h"
end
end

View File

@ -2,19 +2,15 @@ class BuildFromSource < Formula
desc "A run pipe test formula"
homepage "https://github.com/goreleaser"
url "https://github.com/test/test/archive/v1.0.1.tar.gz"
head "https://github.com/test/test.git"
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
head "https://github.com/test/test.git"
depends_on "zsh"depends_on "bash"
depends_on "go" => :build
depends_on "zsh"
depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"

View File

@ -1,36 +0,0 @@
class CustomDownloadStrategu < Formula
desc "A run pipe test formula"
homepage "https://github.com/goreleaser"
url "https://github.com/test/test/releases/download/v1.0.1/bin.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
head "https://github.com/test/test.git"
depends_on "zsh"
depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"
end
def caveats; <<-EOS.undent
don't do this
EOS
end
plist_options :startup => false
def plist; <<~EOS
<xml>whatever</xml>
EOS
end
test do
system "true"
system "#{bin}/foo -h"
end
end

View File

@ -4,14 +4,11 @@ class CustomDownloadStrategy < Formula
url "https://github.com/test/test/releases/download/v1.0.1/bin.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
head "https://github.com/test/test.git"
depends_on "zsh"
depends_on "bash"
depends_on "zsh"depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"

View File

@ -4,14 +4,11 @@ class Default < Formula
url "https://github.com/test/test/releases/download/v1.0.1/bin.tar.gz"
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
head "https://github.com/test/test.git"
depends_on "zsh"
depends_on "bash"
depends_on "zsh"depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"

View File

@ -1,36 +0,0 @@
class GithubEnterpriseUrl < Formula
desc "A run pipe test formula"
homepage "https://github.com/goreleaser"
url "http://github.example.org/test/test/releases/download/v1.0.1/bin.tar.gz"
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
head "https://github.com/test/test.git"
depends_on "zsh"
depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"
end
def caveats; <<-EOS.undent
don't do this
EOS
end
plist_options :startup => false
def plist; <<~EOS
<xml>whatever</xml>
EOS
end
test do
system "true"
system "#{bin}/foo -h"
end
end

View File

@ -4,14 +4,11 @@ class GithubEnterpriseUrl < Formula
url "http://github.example.org/test/test/releases/download/v1.0.1/bin.tar.gz"
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
head "https://github.com/test/test.git"
depends_on "zsh"
depends_on "bash"
depends_on "zsh"depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"

View File

@ -4,8 +4,7 @@ class Test < Formula
url "https://github.com/caarlos0/test/releases/download/v0.1.3/test_Darwin_x86_64.tar.gz"
version "0.1.3"
sha256 "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68"
head "https://github.com/caarlos0/test.git"
depends_on "gtk+"
conflicts_with "svn"