Skip to content

Commit

Permalink
Fix datatype for "busy_exclusion_list"
Browse files Browse the repository at this point in the history
Add conditional data type correction.
purrr::map_at("busy_exclusion_list", as.list)
  • Loading branch information
GegznaV committed Aug 26, 2023
1 parent 2af2d68 commit 811cd1a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/settings--preferences.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ rstudio_set_preferences <- function(file) {
pref <- jsonlite::fromJSON(file)
purrr::walk2(
names(pref), unname(pref),
~{
~ {
tryCatch(
rstudioapi::writeRStudioPreference(.x, .y),
error = function(e) {
Expand Down Expand Up @@ -206,14 +206,16 @@ rstudio_set_preferences <- function(file) {
#' }}
rstudio_compare_user_settings <- function(to = "bio-default") {
to <- match.arg(to, c("bio-default", "rstudio-default"))

file <- get_path_rstudio_config_file(which = to)
default_prefs <-
jsonlite::fromJSON(file) %>%
purrr::map_if(is.integer, as.numeric)
purrr::map_if(is.integer, as.numeric) |>
purrr::map_at("busy_exclusion_list", as.list)

pref_names <- names(default_prefs) %>% purrr::set_names(., .)
current_prefs <-
purrr::map(pref_names, ~rstudioapi::readRStudioPreference(., NULL)) %>%
purrr::map(pref_names, ~rstudioapi::readRStudioPreference(., NULL)) %>%
purrr::map_if(is.integer, as.numeric)

usethis::ui_info(
Expand Down

0 comments on commit 811cd1a

Please sign in to comment.