Uplink cp upload improvements (#480)
* Uplick cp upload improvements * fix formatting
This commit is contained in:
parent
2dbada73ab
commit
6ffded3186
@ -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{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user