Uplink cp upload improvements (#480)

* Uplick cp upload improvements

* fix formatting
This commit is contained in:
Michal Niewrzal 2018-10-16 14:10:41 +02:00 committed by GitHub
parent 2dbada73ab
commit 6ffded3186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,15 @@ func upload(ctx context.Context, bs buckets.Store, src fpath.FPath, dst fpath.FP
return err
}
if fi.IsDir() {
return fmt.Errorf("source cannot be a directory: %s", src)
}
o, err := bs.GetObjectStore(ctx, dst.Bucket())
if err != nil {
return err
}
r := io.Reader(f)
var bar *pb.ProgressBar
if *progress {
@ -76,11 +85,6 @@ func upload(ctx context.Context, bs buckets.Store, src fpath.FPath, dst fpath.FP
r = bar.NewProxyReader(r)
}
o, err := bs.GetObjectStore(ctx, dst.Bucket())
if err != nil {
return err
}
meta := objects.SerializableMeta{}
expTime := time.Time{}