diff --git a/mirror-url.go b/mirror-url.go index 30f4c0ab..43990a62 100644 --- a/mirror-url.go +++ b/mirror-url.go @@ -90,6 +90,11 @@ func checkMirrorSyntax(ctx *cli.Context) { fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("Target ā€˜%s’ does not contain bucket name.", tgtURL)) } } + _, _, err = url2Stat(tgtURL) + // we die on any error other than client.PathNotFound - destination directory need not exist. + if _, ok := err.ToGoError().(client.PathNotFound); !ok { + fatalIf(err.Trace(), fmt.Sprintf("Unable to stat %s", tgtURL)) + } } }