fs: add --metadata-set flag to specify metadata for uploads

This commit is contained in:
Nick Craig-Wood
2022-05-24 15:46:07 +01:00
parent 0652ec95db
commit c4451bc43a
8 changed files with 173 additions and 1 deletions

View File

@@ -489,6 +489,9 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
for _, option := range ci.UploadHeaders {
options = append(options, option)
}
if ci.MetadataSet != nil {
options = append(options, fs.MetadataOption(ci.MetadataSet))
}
if doUpdate {
actionTaken = "Copied (replaced existing)"
err = dst.Update(ctx, in, wrappedSrc, options...)
@@ -1381,6 +1384,9 @@ func Rcat(ctx context.Context, fdst fs.Fs, dstFileName string, in io.ReadCloser,
for _, option := range ci.UploadHeaders {
options = append(options, option)
}
if ci.MetadataSet != nil {
options = append(options, fs.MetadataOption(ci.MetadataSet))
}
compare := func(dst fs.Object) error {
var sums map[hash.Type]string