fix: dependencies and conflicts on brew tap

They were being inlined, generating an invalid receipt.

closes #416
This commit is contained in:
Carlos Alexandro Becker
2017-11-13 18:02:25 -02:00
committed by Carlos Alexandro Becker
parent 752c0711e1
commit adc2d7d4c5
4 changed files with 12 additions and 9 deletions
+4 -4
View File
@@ -67,7 +67,7 @@ func TestFullFormulae(t *testing.T) {
bts, err := ioutil.ReadFile("testdata/test.rb")
assert.NoError(t, err)
// ioutil.WriteFile("testdata/test.rb", []byte(formulae), 0644)
assert.Equal(t, string(bts), formulae)
}
@@ -116,8 +116,8 @@ func TestRunPipe(t *testing.T) {
Caveats: "don't do this",
Test: "system \"true\"\nsystem \"#{bin}/foo -h\"",
Plist: `<xml>whatever</xml>`,
Dependencies: []string{"zsh"},
Conflicts: []string{"gtk+"},
Dependencies: []string{"zsh", "bash"},
Conflicts: []string{"gtk+", "qt"},
Install: `bin.install "foo"`,
},
},
@@ -136,7 +136,7 @@ func TestRunPipe(t *testing.T) {
bts, err := ioutil.ReadFile("testdata/run_pipe.rb")
assert.NoError(t, err)
// assert.NoError(ioutil.WriteFile("testdata/run_pipe.rb", []byte(client.Content), 0644))
// ioutil.WriteFile("testdata/run_pipe.rb", []byte(client.Content), 0644)
assert.Equal(t, string(bts), client.Content)
}
+2 -3
View File
@@ -28,14 +28,13 @@ const formulaTemplate = `class {{ .Name }} < Formula
sha256 "{{ .SHA256 }}"
{{- if .Dependencies }}
{{ range $index, $element := .Dependencies -}}
{{ range $index, $element := .Dependencies }}
depends_on "{{ . }}"
{{- end }}
{{- end -}}
{{- if .Conflicts }}
{{ range $index, $element := .Conflicts -}}
{{ range $index, $element := .Conflicts }}
conflicts_with "{{ . }}"
{{- end }}
{{- end }}
+4 -1
View File
@@ -4,9 +4,12 @@ class RunPipe < Formula
url "https://github.com/test/test/releases/download/v1.0.1/bin.tar.gz"
version "1.0.1"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
depends_on "zsh"
depends_on "bash"
conflicts_with "gtk+"
conflicts_with "qt"
def install
bin.install "foo"
+2 -1
View File
@@ -4,8 +4,9 @@ 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"
depends_on "gtk+"
conflicts_with "svn"
def install