Skip to content

Commit

Permalink
update per feedback
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed Jun 6, 2022
1 parent cb19b4c commit 57b55f2
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions pkg/commands/options/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ The --local flag might be deprecated in the future.
-----------------------------------------------------------------
`

const platformsFlagWarning = `ERROR!
-----------------------------------------------------------------------
The --platform was set with all and other specific platforms.
Please choose either all or a specific one, ie. --platform=linux/arm64
-----------------------------------------------------------------------
`

func Validate(po *PublishOptions, bo *BuildOptions) error {
if po.Bare && po.BaseImportPaths {
log.Print(bareBaseFlagsWarning)
Expand All @@ -59,18 +51,11 @@ func Validate(po *PublishOptions, bo *BuildOptions) error {
}

if len(bo.Platforms) > 1 {
hasAll := false

for _, platform := range bo.Platforms {
if platform == "all" {
hasAll = true
return errors.New("all or specific platforms should be used")
}
}

if hasAll {
log.Print(platformsFlagWarning)
return errors.New("all or specific platforms should be used")
}
}

return nil
Expand Down

0 comments on commit 57b55f2

Please sign in to comment.