diff --git a/pkg/commands/options/validate.go b/pkg/commands/options/validate.go index 4106bd6441..142e16b79c 100644 --- a/pkg/commands/options/validate.go +++ b/pkg/commands/options/validate.go @@ -15,6 +15,7 @@ package options import ( + "errors" "log" "strings" ) @@ -49,5 +50,13 @@ func Validate(po *PublishOptions, bo *BuildOptions) error { log.Print(localFlagsWarning) } + if len(bo.Platforms) > 1 { + for _, platform := range bo.Platforms { + if platform == "all" { + return errors.New("all or specific platforms should be used") + } + } + } + return nil }