In Linux, using the force flag when removing directories (rm -rf) doesn't throw an error if the directory doesn't exist. This is by design: -rf is the equivalent of saying "just make sure the directory doesn't exist". That allows it to be used idempotently in scripts.
Similarly I think the --force flag in mc rb --force minio/my bucket should make the command idempotent. Instead of exiting with an exit code of 1 and mc: <ERROR> Unable to validate target 'minio/my-bucket'. Bucket 'my-bucket' does not exist message, it would be better if the exit code was 0 and a simpler informational message like mc: Bucket 'my-bucket' does not exist was shown.
Similar to https://github.com/minio/mc/issues/4863
In Linux, using the force flag when removing directories (
rm -rf
) doesn't throw an error if the directory doesn't exist. This is by design:-rf
is the equivalent of saying "just make sure the directory doesn't exist". That allows it to be used idempotently in scripts.Similarly I think the
--force
flag inmc rb --force minio/my bucket
should make the command idempotent. Instead of exiting with an exit code of 1 andmc: <ERROR> Unable to validate target 'minio/my-bucket'. Bucket 'my-bucket' does not exist
message, it would be better if the exit code was 0 and a simpler informational message likemc: Bucket 'my-bucket' does not exist
was shown.