You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
597B

  1. #! /usr/bin/env Rscript
  2. library(sass)
  3. library(fs)
  4. library(purrr)
  5. render_sass <- function(file, output = NULL, outdir = "rsthemes") {
  6. if (is.null(output)) {
  7. output <- file
  8. path_ext(output) <- "rstheme"
  9. }
  10. output <- path(outdir, output)
  11. sass(sass_file(paste(file)), output = output)
  12. }
  13. dir_create("rsthemes")
  14. dir_ls(regexp = "^[^_].+\\.scss") %>%
  15. walk(render_sass)
  16. cp_to_rstudio <- function(file) {
  17. file_copy(
  18. file,
  19. path_home_r(".R", "rstudio", "themes", path_file(file)),
  20. overwrite = TRUE
  21. )
  22. }
  23. dir_ls("rsthemes", regexp = "\\.rstheme") %>%
  24. walk(cp_to_rstudio)