1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-29 01:44:39 +02:00

Make build ignore fields additive. Fixes #293.

This commit is contained in:
Jorin Vogel 2017-07-10 13:44:07 +02:00
parent d115d4bd6c
commit 77f366ba57
No known key found for this signature in database
GPG Key ID: 647AFD30D56CE8CC
2 changed files with 15 additions and 3 deletions

View File

@ -40,10 +40,16 @@ func allBuildTargets(build config.Build) (targets []Target) {
func ignored(build config.Build, target Target) bool {
for _, ig := range build.Ignore {
var ignored = New(ig.Goos, ig.Goarch, ig.Goarm)
if ignored == target {
return true
if ig.Goos != "" && ig.Goos != target.OS {
continue
}
if ig.Goarch != "" && ig.Goarch != target.Arch {
continue
}
if ig.Goarm != "" && ig.Goarm != target.Arm {
continue
}
return true
}
return false
}

View File

@ -15,6 +15,7 @@ func TestAllBuildTargets(t *testing.T) {
"linux",
"darwin",
"freebsd",
"openbsd",
},
Goarch: []string{
"386",
@ -34,6 +35,9 @@ func TestAllBuildTargets(t *testing.T) {
Goos: "linux",
Goarch: "arm",
Goarm: "7",
}, {
Goos: "openbsd",
Goarch: "arm",
},
},
}
@ -47,6 +51,8 @@ func TestAllBuildTargets(t *testing.T) {
New("freebsd", "amd64", ""),
New("freebsd", "arm", "6"),
New("freebsd", "arm", "7"),
New("openbsd", "386", ""),
New("openbsd", "amd64", ""),
}, All(build))
}