Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
vortexing committed Feb 20, 2020
1 parent cee30ce commit d707d77
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions R/s3functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,11 @@ summarizeS3Objects <- function(bucket) {
#' Requires valid admin S3 credentials to be set in the environment by setCreds and the likely the output from cromwellOutput()
#' @export
s3_copy_and_tag <- function(fromBucket, fromPrefix, toBucket, toPrefix, tagList) {
if ("" %in% Sys.getenv(c("S3A", "S3SA"))) {
if ("" %in% Sys.getenv(c("AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"))) {
stop("You have missing environment variables. Please setCreds().")
}
if (is.list(tagList) == F) {stop("tagList needs to be a named list for this to work like you want it to.")} else {
if(Sys.getenv("AWS_ACCESS_KEY_ID") == "") {
Sys.setenv(AWS_ACCESS_KEY_ID = Sys.getenv("S3A"),
AWS_SECRET_ACCESS_KEY = Sys.getenv("S3SA"),
AWS_DEFAULT_REGION = "us-west-2")}

} else message("Credentials set successfully.")
if (is.list(tagList) == F) {stop("tagList needs to be a named list for this to work like you want it to.")
} else {
if ("molecular_id" %in% names(tagList)){
a <- aws.s3::copy_object(from_object = fromPrefix,
from_bucket = fromBucket,
Expand Down

0 comments on commit d707d77

Please sign in to comment.