Просмотр исходного кода

report theme name when installing

one
Garrick Aden-Buie 7 лет назад
Родитель
Сommit
6b8fab30fb
1 измененных файлов: 10 добавлений и 1 удалений
  1. +10
    -1
      make.R

+ 10
- 1
make.R Просмотреть файл

@@ -20,8 +20,17 @@ cli_alert_info("Compiling themes...")
dir_ls("src", regexp = "^[^_].+\\.scss") %>%
walk(render_sass)

get_theme_name <- function(file) {
x <- readLines(file, warn = FALSE)
x <- grep("rs-theme-name", x, value = TRUE)
if (!length(x)) return("")
x <- sub("^\\s*/\\*\\s*rs-theme-name:\\s", "", x)
x <- sub("\\s*\\*/\\s*$", "", x)
x
}

cp_to_rstudio <- function(file) {
cli_alert("{path {path_file(file)}}")
cli_alert("{emph {get_theme_name(file)}}")
file_copy(
file,
path_home_r(".R", "rstudio", "themes", path_file(file)),

Загрузка…
Отмена
Сохранить