R/build_batch.R

Defines functions build_batch

#' Create a batch file for updating a person file.
#' @description
#' @param password_required
#' @param folder_dir
#' @return
#' @examples
#' @export

build_batch <- function(folder_dir = ".", password_required = FALSE) {
  R.utils::isAbsolutePath(".")
  folder_dir <- R.utils::getAbsolutePath(".")
  path <- paste0(R.home("bin"),"/Rscript.exe")
  fileConn <- file("personfiles.bat")
  writeLines(c("echo off",
               "set /p name=Name:",
               paste(c(path,"person.R","%name%"),collapse=" "),
               "exit"), fileConn)
  close(fileConn)
}
loelschlaeger/personfiles documentation built on Dec. 21, 2021, 11:45 a.m.