R/isgit.R

Defines functions isGit

Documented in isGit

#' Determine if git repo is present
#'
#' Returns TRUE if working directory is a git repository
#'
#' @export

isGit <- function() {

    suppressWarnings(
		    git <- system2("git","rev-parse ",
				   stdout=TRUE,stderr=FALSE)
		    )


    if(!is.null(attributes(git))) {
	isGit <- FALSE
    } else {
	isGit <- TRUE
    }

    return(isGit)

}
     
jspijker/datacube documentation built on Oct. 26, 2019, 4:30 p.m.