Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Mar 19, 2024
1 parent e420018 commit fc1f480
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
18 changes: 10 additions & 8 deletions R/bucket.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ bucket_create_if_not <- function(bucket, force = FALSE) {
#' @examplesIf interactive()
#' bucket_name <- "bucket-to-delete-113"
#' if (!aws_bucket_exists(bucket_name)) {
#' aws_bucket_create(bucket = bucket_name)
#' aws_buckets()
#' aws_bucket_delete(bucket = bucket_name)
#' aws_buckets()
#' aws_bucket_create(bucket = bucket_name)
#' aws_buckets()
#' aws_bucket_delete(bucket = bucket_name)
#' aws_buckets()
#' }
aws_bucket_delete <- function(bucket, force = FALSE, ...) {
# TODO: add a package level option to override the prompt for adv. users
Expand Down Expand Up @@ -141,7 +141,7 @@ aws_bucket_download <- function(bucket, dest_path, ...) {
#' # cleanup
#' objs <- aws_bucket_list_objects(bucket_name)
#' aws_file_delete(objs$uri)
#' aws_bucket_delete(bucket_name, force=TRUE)
#' aws_bucket_delete(bucket_name, force = TRUE)
#' aws_bucket_exists(bucket_name)
aws_bucket_upload <- function(
path, bucket, max_batch = fs::fs_bytes("100MB"),
Expand Down Expand Up @@ -233,8 +233,10 @@ aws_buckets <- function(...) {
#' demo_file <- file.path(system.file(), "Meta/demo.rds")
#' aws_file_upload(
#' c(links_file, pkgs_file, demo_file),
#' s3_path(bucket_name,
#' c(basename(links_file),
#' s3_path(
#' bucket_name,
#' c(
#' basename(links_file),
#' basename(pkgs_file),
#' basename(demo_file)
#' )
Expand All @@ -245,7 +247,7 @@ aws_buckets <- function(...) {
#' # cleanup
#' objs <- aws_bucket_list_objects(bucket_name)
#' aws_file_delete(objs$uri)
#' aws_bucket_delete(bucket_name, force=TRUE)
#' aws_bucket_delete(bucket_name, force = TRUE)
#' aws_bucket_exists(bucket_name)
aws_bucket_tree <- function(bucket, recurse = TRUE, ...) {
s3fs::s3_dir_tree(s3_path(bucket), recurse = recurse, ...)
Expand Down
6 changes: 3 additions & 3 deletions R/s3.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ aws_bucket_add_user <- function(bucket, username, permissions) {
}
user_data <- aws_user(username)
if (NROW(user_data$attached_policies) == 0) {
aws_user(username) %>% aws_policy_attach(policy_name)
cli::cli_alert_success(add_user_now_has)
return(invisible())
aws_user(username) %>% aws_policy_attach(policy_name)
cli::cli_alert_success(add_user_now_has)
return(invisible())
}
if (policy_name %in% user_data$attached_policies$PolicyName) {
cli::cli_alert_success(add_user_already)
Expand Down

0 comments on commit fc1f480

Please sign in to comment.