googledrive
googledrive copied to clipboard
drive_mkdir throws error when folder name includes quote
If I try to create a folder with a quote in its name, such as "Let's test", googledrive::drive_mkdir() throws an error. The error message changes slightly if the parent folder is given or not, see example below.
Also, if the parent folder is given, the folder "Let's test" is actually created, even if an error is thrown and no dribble is returned.
library("googledrive")
# without giving parent folder
googledrive::drive_mkdir(name = "let's test")
#> Error in `confirm_clear_path()`:
#> ! Unclear if `path` specifies parent folder or full path to the new
#> file, including its name.
#> See `?as_dribble()` for advice on how to make this clear.
base_dribble <- googledrive::drive_mkdir("test_base")
#> Created Drive file:
#> • 'test_base' <id: 1NCDlCW0HdgEGz8YXegTQO1yZrdA5NGWF>
#> With MIME type:
#> • 'application/vnd.google-apps.folder'
# When giving parent folder
googledrive::drive_mkdir(name = "let's test", path = base_dribble)
#> Error in glue_data(.x = NULL, ..., .sep = .sep, .envir = .envir, .open = .open, : Unterminated quote (')
# but folder actually created:
googledrive::drive_ls(path = base_dribble)
#> # A dribble: 1 × 3
#> name id drive_resource
#> <chr> <drv_id> <list>
#> 1 let's test 1Sc3_qjHH4-TXCNmM4SE4AmdOeWHfCMmE <named list [33]>
Created on 2022-07-16 by the reprex package (v2.0.1)