R/remote_url.R

Defines functions remote_url

Documented in remote_url

#' Get Git Remote URL
#' @param remote_name Name of the remote. Defaults to "Origin".
#' @return url of the remote as a string
#' @export

remote_url <-
        function(path_to_local_repo = NULL,
                 remote_name = "origin") {

                if (is.null(path_to_local_repo)) {

                        path_to_local_repo <- getwd()

                }

                suppressWarnings(
                system(paste0("cd\n",
                              "cd ", path_to_local_repo,"\n",
                              "git remote get-url ", remote_name),
                       ignore.stderr = TRUE,
                       intern = TRUE)
                )
        }
patelm9/glitter documentation built on Sept. 21, 2020, 5:42 p.m.