rstudio / pins-r

Pin, discover, and share resources
https://pins.rstudio.com
Other
312 stars 63 forks source link

Inconsistent handling of ~ path expansion #585

Closed sellorm closed 2 years ago

sellorm commented 2 years ago

In some places this works as expected, for instance in board_folder it works fine.

However, when specifying files for upload with pin_upload it does not work - see below.

In addition, the error message refers to a variable name 'path', which is not used in the function call, which instead uses 'paths'.

board <- pins::board_folder("~/tmp/pins")

board |> pins::pin_upload("~/Documents/all_the_things.jpg")
#> Error: All elements of `path` must exist

rlang::last_error()
#> <error/rlang_error>
#> All elements of `path` must exist
#> Backtrace:
#>  1. pins::pin_upload(board, "~/Documents/all_the_things.jpg")
#> Run `rlang::last_trace()` to see the full context.

rlang::last_trace()
#> <error/rlang_error>
#> All elements of `path` must exist
#> Backtrace:
#>     █
#>  1. └─pins::pin_upload(board, "~/Documents/all_the_things.jpg")

board |> pins::pin_upload(fs::path_expand("~/Documents/all_the_things.jpg"))
#> Guessing `name = 'all_the_things.jpg'`
#> Replacing version '20220110T114602Z-07164' with '20220110T114753Z-07164'
github-actions[bot] commented 2 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.