Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

34 lines
979B

  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_create("dist")
  8. cli_alert_info("Prepping base16 themes...")
  9. dir_ls("src/palettes/base16/", regexp = "_base16.+scss") %>%
  10. walk(base16_make_theme)
  11. cli_alert_info("Compiling themes...")
  12. dir_ls("src", regexp = "^[^_].+\\.scss") %>%
  13. walk(render_sass)
  14. cli_alert_success('Installing themes to {path {path_home_r(".R", "rstudio", "themes")}}')
  15. dir_ls("dist", regexp = "\\.rstheme") %>%
  16. walk(cp_to_rstudio)
  17. current_theme <- if (rstudioapi::hasFun("getThemeInfo")) {
  18. rstudioapi::getThemeInfo()$editor
  19. } else ""
  20. if (current_theme != "" && current_theme %in% list_sassy_themes()) {
  21. cli_alert_success("Reloading {strong {current_theme}}")
  22. rstudioapi::applyTheme(current_theme)
  23. } else {
  24. cli_alert_info("Use {code {fun list_sassy_themes}} to list Sassy RStudio themes")
  25. cli_alert_info("Use {code {fun rstudioapi::applyTheme}} to enable the above themes")
  26. }