Use with_drive_quiet() to run a small bit of code silently
with_drive_quiet(
drive_something(...)
)
local_drive_quiet() and with_drive_quiet() follow the conventions of the the withr package (https://withr.r-lib.org).
Examples
# message: "Created Drive file"(x <- drive_create("drive-quiet-demo", type ="document"))# message: "File updated"x <- drive_update(x, starred =TRUE)drive_reveal(x,"starred")# suppress messages for a small amount of codewith_drive_quiet( x <- drive_update(x, name ="drive-quiet-works"))x$name
# message: "File updated"x <- drive_update(x, media = drive_example_local("chicken.txt"))# suppress messages within a specific scope, e.g. functionunstar <-function(y){ local_drive_quiet() drive_update(y, starred =FALSE)}x <- unstar(x)drive_reveal(x,"starred")# Clean updrive_rm(x)