Let target directory be created if doesn't exist with prefix path
This commit is contained in:
+1
-1
@@ -169,7 +169,7 @@ func checkCastSyntaxTypeC(srcURL string, tgtURLs []string) {
|
||||
}
|
||||
for _, tgtURL := range tgtURLs {
|
||||
if !isTargetURLDir(tgtURL) {
|
||||
console.Fatalf("One of the target ‘%s’ is not a folder. cannot have mixtures of directories and files while copying directories. %s\n", tgtURL, NewIodine(iodine.New(errInvalidArgument{}, nil)))
|
||||
console.Fatalf("One of the target ‘%s’ is not a folder. cannot have mixtures of directories and files while copying directories recursively. %s\n", tgtURL, NewIodine(iodine.New(errInvalidArgument{}, nil)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,11 +170,10 @@ func checkCopySyntaxTypeC(srcURLs []string, tgtURL string) {
|
||||
|
||||
_, tgtContent, err := url2Stat(tgtURL)
|
||||
// Target exist?.
|
||||
if err != nil {
|
||||
console.Fatalf("Unable to stat target ‘%s’. %s\n", tgtURL, NewIodine(iodine.New(err, nil)))
|
||||
}
|
||||
if !tgtContent.Type.IsDir() {
|
||||
console.Fatalf("Target ‘%s’ is not a folder. %s\n", tgtURL, NewIodine(iodine.New(errInvalidArgument{}, nil)))
|
||||
if err == nil {
|
||||
if !tgtContent.Type.IsDir() {
|
||||
console.Fatalf("Target ‘%s’ is not a folder. %s\n", tgtURL, NewIodine(iodine.New(errInvalidArgument{}, nil)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user