Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

38 rindas
1.1KB

  1. #! /usr/bin/env Rscript
  2. library(sass)
  3. library(fs)
  4. library(purrr)
  5. library(cliapp)
  6. source("R/make_functions.R")
  7. dir_delete("dist")
  8. dir_create("dist")
  9. cli_alert_info("Prepping base16 themes...")
  10. file_delete(dir_ls("src", regexp = "base16.+scss$"))
  11. dir_ls("src/palettes/base16/", regexp = "_base16.+scss") %>%
  12. walk(base16_make_theme)
  13. cli_alert_info("Compiling themes...")
  14. dir_ls("src", regexp = "^[^_].+\\.scss") %>%
  15. walk(render_sass)
  16. cli_alert_success('Installing themes to {path {path_home_r(".R", "rstudio", "themes")}}')
  17. dir_ls("dist", regexp = "\\.rstheme") %>%
  18. walk(cp_to_rstudio)
  19. current_theme <- if (rstudioapi::hasFun("getThemeInfo")) {
  20. rstudioapi::getThemeInfo()$editor
  21. } else ""
  22. if (current_theme != "" && current_theme %in% list_sassy_themes()) {
  23. cli_alert_success("Reloading {strong {current_theme}}")
  24. rstudioapi::applyTheme(current_theme)
  25. } else {
  26. if (interactive()) {
  27. cli_alert_info("Use {code {fun list_sassy_themes}} to list Sassy RStudio themes")
  28. }
  29. cli_alert_info("Use {code {fun rstudioapi::applyTheme}} to enable the above themes")
  30. }