R/tailwind-run.R

Defines functions tailwind_bin tailwind_run

Documented in tailwind_run

#' @title Run Tailwind Commands
#'
#' @description
#' After `tailwind_install()`, you can run tailwind commands arbitrarily using
#' `tailwind_run`.
#'
#' @param ... (arg) passed to [processx::run]
#'
#' @family Tailwind CSS
#' @export
tailwind_run <- function(...) {

  invisible(
    run(
      command = assert_file_exists(tailwind_bin()),
      ...,
      spinner = TRUE,
      echo_cmd = TRUE,
      echo = TRUE
    )
  )

}

tailwind_bin <- function() {
  path(tailwind_dir(), "node_modules", ".bin", "tailwindcss")
}
tjpalanca/tailwind.R documentation built on Dec. 23, 2021, 10:59 a.m.