Переглянути джерело

make make executable

light
Garrick Aden-Buie 7 роки тому
джерело
коміт
f7a826fb85
1 змінених файлів з 14 додано та 3 видалено
  1. +14
    -3
      make.R

+ 14
- 3
make.R Переглянути файл

@@ -1,3 +1,4 @@
#! /usr/bin/env Rscript
library(sass)
library(fs)
library(purrr)
@@ -8,11 +9,21 @@ render_sass <- function(file, output = NULL, outdir = "rsthemes") {
path_ext(output) <- "rstheme"
}
output <- path(outdir, output)
out_sass <- sass(sass_file(paste(file)))
writeLines(out_sass, output)
sass(sass_file(paste(file)), output = output)
}

dir_create("rsthemes")

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

cp_to_rstudio <- function(file) {
file_copy(
file,
path_home_r(".R", "rstudio", "themes", path_file(file)),
overwrite = TRUE
)
}

dir_ls("rsthemes", regexp = "\\.rstheme") %>%
walk(cp_to_rstudio)

Завантаження…
Відмінити
Зберегти