| dir_ls("src", regexp = "^[^_].+\\.scss") %>% | dir_ls("src", regexp = "^[^_].+\\.scss") %>% | ||||
| walk(render_sass) | walk(render_sass) | ||||
| get_theme_name <- function(file) { | |||||
| x <- readLines(file, warn = FALSE) | |||||
| x <- grep("rs-theme-name", x, value = TRUE) | |||||
| if (!length(x)) return("") | |||||
| x <- sub("^\\s*/\\*\\s*rs-theme-name:\\s", "", x) | |||||
| x <- sub("\\s*\\*/\\s*$", "", x) | |||||
| x | |||||
| } | |||||
| cp_to_rstudio <- function(file) { | cp_to_rstudio <- function(file) { | ||||
| cli_alert("{path {path_file(file)}}") | |||||
| cli_alert("{emph {get_theme_name(file)}}") | |||||
| file_copy( | file_copy( | ||||
| file, | file, | ||||
| path_home_r(".R", "rstudio", "themes", path_file(file)), | path_home_r(".R", "rstudio", "themes", path_file(file)), |