check if sources exist (#1685)
This commit is contained in:
committed by
Harshavardhana
parent
264f1ef992
commit
65a31e34c9
+2
-3
@@ -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
|
||||
|
||||
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user