R/stop_if_not_git_repo.R

Defines functions stop_if_not_git_repo

Documented in stop_if_not_git_repo

#' Stop if not repo
#' @export


stop_if_not_git_repo <-
        function(path_to_local_repo = NULL) {

                if (is.null(path_to_local_repo)) {

                        path_to_local_repo <- getwd()

                }

                if (!isRepo(path_to_local_repo = path_to_local_repo)) {

                        stop(path_to_local_repo, " is not a git repository")

                }

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