R/stop_if_dir_not_exist.R

Defines functions stop_if_dir_not_exist

Documented in stop_if_dir_not_exist

#' Stop if the directory does not exist
#' @export

stop_if_dir_not_exist <-
        function(path_to_local_repo = NULL) {

                if (is.null(path_to_local_repo)) {

                        path_to_local_repo <- getwd()

                }

                if (!(dir.exists(path_to_local_repo))) {

                        stop(path_to_local_repo, " doesn't exist")

                }

        }
patelm9/glitter documentation built on Sept. 21, 2020, 5:42 p.m.