diff --git a/NEWS.md b/NEWS.md index 40c258dc7..1e8929963 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,8 +7,9 @@ * Increased datetime precision to the second, for `pin_versions()` and related functions (#642, @tomsing1). -* Pass the dots from `pin_write()` through to `s3_upload_file()` to support - S3 tagging, encryption options, etc for pins (#648). +* Pass the dots from `pin_write()` through to `s3_upload_file()` and + `s3_uploade_yaml()` to support S3 tagging, encryption options, etc for + pins (#648, #652, @fh-mthomson). # pins 1.0.2 diff --git a/R/board_s3.R b/R/board_s3.R index 09b7401ff..a876513ff 100644 --- a/R/board_s3.R +++ b/R/board_s3.R @@ -221,7 +221,7 @@ pin_store.pins_board_s3 <- function(board, name, paths, metadata, version <- version_setup(board, name, version_name(metadata), versioned = versioned) version_dir <- fs::path(name, version) - s3_upload_yaml(board, fs::path(version_dir, "data.txt"), metadata) + s3_upload_yaml(board, fs::path(version_dir, "data.txt"), metadata, ...) for (path in paths) { s3_upload_file(board, fs::path(version_dir, fs::path_file(path)), path, ...) } @@ -265,12 +265,13 @@ s3_delete_dir <- function(board, dir) { invisible() } -s3_upload_yaml <- function(board, key, yaml) { +s3_upload_yaml <- function(board, key, yaml, ...) { body <- charToRaw(yaml::as.yaml(yaml)) board$svc$put_object( Bucket = board$bucket, Key = paste0(board$prefix, key), - Body = body + Body = body, + ... ) }