R/brake_if_file_exists.R

Defines functions brake_if_file_exists

Documented in brake_if_file_exists

#' Stops the script from running if the end point exists
#' @param end_point_fn full path to the filename that indicates this script/step has been run already
#' @importFrom typewriteR stop_and_enter
#' @export
#'

brake_if_file_exists <-
        function(end_point_fn) {
                if (file.exists(end_point_fn)) {
                        typewriteR::tell_me(end_point_fn, "already exists. This script has been previously executed and will be overwritten.")
                        typewriteR::stop_and_enter()
                }
        }
patelm9/projektoR documentation built on Dec. 18, 2019, 5:55 a.m.