allow to use --only with post-processors
This commit is contained in:
parent
4bf3cd44fc
commit
61ade0e127
|
@ -76,6 +76,7 @@ func TestBuildOnlyFileMultipleFlags(t *testing.T) {
|
|||
args := []string{
|
||||
"-only=chocolate",
|
||||
"-only=cherry",
|
||||
"-only=apple",
|
||||
filepath.Join(testFixture("build-only"), "template.json"),
|
||||
}
|
||||
|
||||
|
@ -94,6 +95,9 @@ func TestBuildOnlyFileMultipleFlags(t *testing.T) {
|
|||
if !fileExists("cherry.txt") {
|
||||
t.Error("Expected to find cherry.txt")
|
||||
}
|
||||
if !fileExists("apple.txt") {
|
||||
t.Error("Expected to find apple.txt")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildExceptFileCommaFlags(t *testing.T) {
|
||||
|
|
|
@ -182,6 +182,7 @@ func (c *Core) Build(n string) (Build, error) {
|
|||
for _, rawP := range rawPs {
|
||||
// If we skip, ignore
|
||||
rawP.OnlyExcept.Except = append(rawP.OnlyExcept.Except, c.except...)
|
||||
rawP.OnlyExcept.Only = append(rawP.OnlyExcept.Only, c.only...)
|
||||
if rawP.OnlyExcept.Skip(rawName) {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue