fix: mc rb --force return ok with bucketNotExists (#4927)

This commit is contained in:
jiuker
2024-05-09 03:32:30 -07:00
committed by GitHub
parent 45ae31533d
commit 5378c957f5
+7 -1
View File
@@ -258,11 +258,17 @@ func mainRemoveBucket(cliCtx *cli.Context) error {
if err != nil {
switch err.ToGoError().(type) {
case BucketNameEmpty:
case BucketDoesNotExist:
if isForce {
continue
}
errorIf(err.Trace(targetURL), "Unable to validate target `"+targetURL+"`.")
cErr = exitStatus(globalErrorExitStatus)
continue
default:
errorIf(err.Trace(targetURL), "Unable to validate target `"+targetURL+"`.")
cErr = exitStatus(globalErrorExitStatus)
continue
}
}