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

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

@@ -2,6 +2,7 @@
library(sass)
library(fs)
library(purrr)
library(cliapp)

render_sass <- function(file, output = NULL, outdir = "rsthemes") {
if (is.null(output)) {
@@ -9,15 +10,18 @@ render_sass <- function(file, output = NULL, outdir = "rsthemes") {
path_ext(output) <- "rstheme"
}
output <- path(outdir, output)
cli_alert_success("{path {path_file(file)}}")
sass(sass_file(paste(file)), output = output)
}

dir_create("rsthemes")

cli_alert_info("Compiling themes...")
dir_ls(regexp = "^[^_].+\\.scss") %>%
walk(render_sass)

cp_to_rstudio <- function(file) {
cli_alert("{path {path_file(file)}}")
file_copy(
file,
path_home_r(".R", "rstudio", "themes", path_file(file)),
@@ -25,5 +29,6 @@ cp_to_rstudio <- function(file) {
)
}

cli_alert_info('Installing themes to {path {path_home_r(".R", "rstudio", "themes")}}')
dir_ls("rsthemes", regexp = "\\.rstheme") %>%
walk(cp_to_rstudio)

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