R/check_export.R

Defines functions check_export

Documented in check_export

#' Title
#'
#' @param path_to_export
#'
#' @keywords internal
#' @importFrom tools file_ext
check_export <- function(path_to_export){

  if(!is.character(path_to_export)){
    stop("path_to_export is not a character vector")
  }

  if(nchar(path_to_export)==0){
    stop("path_to_export is empty character vector")
  }
  if(!file.exists(path_to_export)){
    stop("export file doesnt exist")
  }
  if(tools::file_ext(path_to_export)!="csv"){
    stop("export is not a csv")
  }

}
tilschuenemann/ledger2 documentation built on March 20, 2022, 8:36 p.m.