ThinkR-open / golem

A Framework for Building Robust Shiny Apps
https://thinkr-open.github.io/golem/
Other
885 stars 130 forks source link

Some `use_{internal,external}_XXX_file()` functions fail without default value for argument `name` [BUG] #1060

Closed ilyaZar closed 11 months ago

ilyaZar commented 1 year ago

Describe the bug The use_{internal,external}_XXX_file() family does not always provide default argument values for name but relies on:

if (missing(name)) {
  name <- basename(path)
}

This is fine when this happens at the top level of the function call. However, often there is check_name_length(name) before the if (missing(name))-part which produces an error.

To Reproduce It's a bit cumbersome to provide a reprex, essentially one generates a new golem and invokes e.g. the use_external_file without a value for the argument name which runs into an error where the check_name_length(name) part gives:

...
argument "name" is missing, with no default
...

image

Additional context

ilyaZar commented 11 months ago

Closed via #1059 #1082