Skip to content

Commit

Permalink
encoding message supressed
Browse files Browse the repository at this point in the history
  • Loading branch information
notPlancha committed Jun 13, 2024
1 parent 4733f62 commit 136681f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions R/mimic.R
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
}
}
)
Expand Down
4 changes: 1 addition & 3 deletions R/sync.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- badges: start -->
[![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)
<!-- badges: end -->

# settingsSync
Expand Down

0 comments on commit 136681f

Please sign in to comment.