Created
July 26, 2020 08:24
-
-
Save pat-s/13f9d72a75e6a54585d9262a8d01b3ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (requireNamespace(c("callr", "git2r", "gert", "cli"), quietly = TRUE)) { | |
has_git = git2r::in_repository() | |
if (has_git && Sys.getenv("RSTUDIO") == 1) { | |
cli::cli_text("Running | |
{.code gert::git_pull(verbose = FALSE, prune = TRUE, rebase = TRUE)} | |
in the background.") | |
callr::r_bg(function() { | |
gert::git_pull(verbose = FALSE, prune = TRUE, rebase = TRUE) | |
}, | |
stdout = out <- tempfile(), stderr = err <- tempfile())$wait() | |
cli::cli_text("stdout: '{readLines(out)}'") | |
cli::cli_text("stderr: '{readLines(err)}'") | |
# cat(readLines(out), sep = "\n") | |
# cat(readLines(err), sep = "\n") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment