1
0
mirror of https://github.com/minio/mc.git synced 2025-11-10 13:42:32 +03:00

cp: Copy recursive paths having the passed prefix (#3563)

This commit is contained in:
Anis Elleuch
2021-01-24 09:06:40 +01:00
committed by GitHub
parent 7e19044d98
commit 130f4393bb
5 changed files with 35 additions and 22 deletions

View File

@@ -23,6 +23,7 @@ import (
"time"
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/minio/pkg/console"
)
@@ -52,7 +53,12 @@ func checkCopySyntax(ctx context.Context, cliCtx *cli.Context, encKeyDB map[stri
// Verify if source(s) exists.
for _, srcURL := range srcURLs {
_, _, err := url2Stat(ctx, srcURL, versionID, false, encKeyDB, timeRef)
var err *probe.Error
if !isRecursive {
_, _, err = url2Stat(ctx, srcURL, versionID, false, encKeyDB, timeRef)
} else {
_, _, err = firstURL2Stat(ctx, srcURL, timeRef)
}
if err != nil {
msg := "Unable to validate source `" + srcURL + "`"
if versionID != "" {