usethis
usethis copied to clipboard
Export `use_rstudio_config()`
Supercedes #1515 per the discussion in #1516
When this gets done, it's a good time to modernize all code where we work with RStudio prefs. It was originally written when RStudio prefs were much harder to get at programmatically and we probably aren't taking full advantage of the current situation.
As one example, why do we have our own functions for reading/writing RStudio preferences? Why aren't we using rstudioapi::writeRStudioPreference()
?
https://rstudio.github.io/rstudioapi/reference/writeRStudioPreference.html
It will also be important to think about the interface of the exported use_rstudio_config()
. There will be the usual decisions re: whether to support use_rstudio_config(name1 = value1, name2 = value2, ...)
, use_rstudio_config(list(name1 = value1, name2 = value2, ...))
, or both.
This will be fantastic! 🥂
A companion function to use_rstudio_config()
to set secondary repositories would also be helpful (e.g. we set our RSPM location at my institution). If a user has never set a secondary repo and the user adds a secondary repository via the GUI, the country is also set (just something to keep in mind if you're adding the repo location).
I'm not sure about the original justification, but as I attempt to rewrite these functions using just the API there are some pain points, like it's much harder to test what you're doing, and the RStudio API appears to be missing some functionality, like the ability to remove a setting.