Skip to content

Commit dcc1d2f

Browse files
committed
if one of the args failed, exit with an error code
1 parent ccba1a0 commit dcc1d2f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: cli/core/upgrade.go

+6
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) {
7171
}
7272

7373
// proceed upgrading, if anything is upgradable
74+
exitErr := false
7475
platformsRefs := parsePlatformReferenceArgs(args)
7576
for i, platformRef := range platformsRefs {
7677
if platformRef.Version != "" {
7778
formatter.PrintErrorMessage(("Invalid item " + args[i]))
79+
exitErr = true
7880
continue
7981
}
8082

@@ -92,4 +94,8 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) {
9294
os.Exit(errorcodes.ErrGeneric)
9395
}
9496
}
97+
98+
if exitErr {
99+
os.Exit(errorcodes.ErrBadArgument)
100+
}
95101
}

0 commit comments

Comments
 (0)