diff --git a/.Rprofile b/.Rprofile index b5ee873..d8c19dc 100644 --- a/.Rprofile +++ b/.Rprofile @@ -4,7 +4,7 @@ if (interactive()) { require(conflicted) require(desc) require(icecream) - require(rhub) + # require(rhub) options(icecream.always.include.context = T) options(error = function() traceback()) # pak("r-lib/desc") # theres a bug @@ -23,7 +23,6 @@ if (interactive()) { mimic_off() } cli::cli_inform("ic_disable() to disable debug prints \n ic_enable() for the opposite") - } build_docs <- \() {devtools::document(roclets = c('rd', 'collate', 'namespace'))} # n sei se este document esta certo mas e o que o rstudio chama diff --git a/DESCRIPTION b/DESCRIPTION index ebed4ed..f8a51af 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: settingsSync Title: 'Rstudio' Addin to Sync Settings and Keymaps -Version: 3.0.1 +Version: 3.0.2 Description: Provides a 'Rstudio' addin to download, merge and upload 'Rstudio' settings and keymaps, essentially 'syncing them' at will. It uses 'Google Drive' as a cloud storage to keep the settings and keymaps files. diff --git a/R/mimic.R b/R/mimic.R index a7a4cc3..4148702 100644 --- a/R/mimic.R +++ b/R/mimic.R @@ -127,9 +127,9 @@ gd <- list( if (tibble::is_tibble(file)) { file <- file.path(get_mimic_folder_gd(), file$path) } - return(read_file(file)) + return(read_file(file, encoding)) } else { - googledrive::drive_read_string(file, ...) + googledrive::drive_read_string(file, encoding = encoding, ...) } } ) diff --git a/R/sync.R b/R/sync.R index 0974c12..e06b92f 100644 --- a/R/sync.R +++ b/R/sync.R @@ -164,8 +164,6 @@ sync <- function(write = NULL, useProgBar = TRUE) { } } - - progBar <- ifelse(useProgBar, progress_bar(6), NULL) # pull, merge and push addins_gd <- read_from_gd("addins", progBar = progBar) @@ -256,7 +254,7 @@ read_from_gd <- function(what, progBar = NULL) { gd$get() if (nrow(file) == 0) {return(data.frame())} file |> - gd$read(encoding = "UTF-8") |> + gd$read() |> jsonlite::fromJSON() |> as.data.frame() -> ret if (progBar |> is.null() |> isFALSE()) progBar() diff --git a/R/utils.R b/R/utils.R index fc0c176..5378731 100644 --- a/R/utils.R +++ b/R/utils.R @@ -33,9 +33,9 @@ rstudio_path <- function() { } #'@noRd -read_file <- function(path) { +read_file <- function(path, encoding = "UTF-8") { if (file.exists(path)) { - readLines(path, warn = FALSE) |> paste(collapse = "\n") + readLines(path, warn = FALSE, encoding = encoding) |> paste(collapse = "\n") } else { character() } diff --git a/README.md b/README.md index 52377d3..7fc4f04 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![R-CMD-check](https://github.com/notPlancha/settingsSync/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/notPlancha/settingsSync/actions/workflows/R-CMD-check.yaml) +[![CRAN status](https://www.r-pkg.org/badges/version/settingsSync)](https://CRAN.R-project.org/package=settingsSync) # settingsSync