Let target directory be created if doesn't exist with prefix path

This commit is contained in:
Harshavardhana
2015-07-26 13:40:27 -07:00
parent ecf020c382
commit 847ef58642
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -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)))
}
}
}
+4 -5
View File
@@ -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)))
}
}
}