Copy should verify for only buckets

This commit is contained in:
Harshavardhana
2015-09-30 13:07:11 -07:00
parent 338fc6b85f
commit 0564b683a5
+4 -2
View File
@@ -81,8 +81,10 @@ func checkCopySyntax(ctx *cli.Context) {
if url.Path == string(url.Separator) {
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("Target ‘%s’ does not contain bucket name.", tgtURL))
}
if err := bucketExists(tgtURL); err != nil {
fatalIf(err.Trace(), fmt.Sprintf("Unable to stat target ‘%s’.", tgtURL))
if strings.Count(url.Path, "/") < 2 {
if err := bucketExists(tgtURL); err != nil {
fatalIf(err.Trace(), fmt.Sprintf("Unable to stat target ‘%s’.", tgtURL))
}
}
}
}