awscli <- function(src, dest, includes = NULL, excludes = NULL, args = "", profile = NULL, intern = FALSE) {
constructArg <- function(x, s) {
if (is.null(x)) {
return(x)
}
paste(paste0(s, " \"", x, "\""), collapse = " ")
}
includes <- constructArg(includes, "--include")
excludes <- constructArg(excludes, "--exclude")
profile <- if (is.null(profile)) "" else paste("--profile", profile)
dest <- paste("\"", dest, "\"", sep = "")
src <- if (!is.null(src)) paste("\"", src, "\"", sep = "") else NULL
command <- paste(
"aws s3",
args,
excludes,
includes,
profile,
src,
dest
)
# cat(command, "\n")
system(command, intern = intern, wait = TRUE, ignore.stdout = FALSE, ignore.stderr = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.