| @@ -4,20 +4,20 @@ library(fs) | |||
| library(purrr) | |||
| library(cliapp) | |||
| render_sass <- function(file, output = NULL, outdir = "rsthemes") { | |||
| render_sass <- function(file, output = NULL, outdir = "dist") { | |||
| if (is.null(output)) { | |||
| output <- file | |||
| output <- path_file(file) | |||
| path_ext(output) <- "rstheme" | |||
| } | |||
| output <- path(outdir, output) | |||
| cli_alert_success("{path {path_file(file)}}") | |||
| cli_alert_success("{path {path_rel(file, getwd())}}") | |||
| sass(sass_file(paste(file)), output = output) | |||
| } | |||
| dir_create("rsthemes") | |||
| dir_create("dist") | |||
| cli_alert_info("Compiling themes...") | |||
| dir_ls(regexp = "^[^_].+\\.scss") %>% | |||
| dir_ls("src", regexp = "^[^_].+\\.scss") %>% | |||
| walk(render_sass) | |||
| cp_to_rstudio <- function(file) { | |||
| @@ -30,5 +30,5 @@ cp_to_rstudio <- function(file) { | |||
| } | |||
| cli_alert_info('Installing themes to {path {path_home_r(".R", "rstudio", "themes")}}') | |||
| dir_ls("rsthemes", regexp = "\\.rstheme") %>% | |||
| dir_ls("dist", regexp = "\\.rstheme") %>% | |||
| walk(cp_to_rstudio) | |||