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:
parent
d115d4bd6c
commit
77f366ba57
@ -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
|
||||
}
|
||||
|
@ -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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user