check if sources exist (#1685)

This commit is contained in:
Anand Babu (AB) Periasamy
2016-04-15 16:59:38 -07:00
committed by Harshavardhana
parent 264f1ef992
commit 65a31e34c9
2 changed files with 10 additions and 3 deletions
+2 -3
View File
@@ -298,10 +298,9 @@ func (f *fsClient) Remove(incomplete bool) *probe.Error {
// List - list files and folders.
func (f *fsClient) List(recursive, incomplete bool) <-chan *clientContent {
contentCh := make(chan *clientContent)
switch recursive {
case true:
if recursive {
go f.listRecursiveInRoutine(contentCh, incomplete)
default:
} else {
go f.listInRoutine(contentCh, incomplete)
}
return contentCh
+8
View File
@@ -38,6 +38,14 @@ func checkCopySyntax(ctx *cli.Context) {
isRecursive := ctx.Bool("recursive")
/****** Generic Invalid Rules *******/
// Verify if source(s) exists.
for _, srcURL := range srcURLs {
_, _, err := url2Stat(srcURL)
if err != nil {
fatalIf(err.Trace(srcURL), fmt.Sprintf("Unable to stat '%s'.", srcURL))
}
}
// Check if bucket name is passed for URL type arguments.
url := newClientURL(tgtURL)
if url.Host != "" {