Skip to content

Instantly share code, notes, and snippets.

@pat-s
Created July 25, 2020 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pat-s/57dab3cfcb821928d1a9e819d06ea60b to your computer and use it in GitHub Desktop.
Save pat-s/57dab3cfcb821928d1a9e819d06ea60b to your computer and use it in GitHub Desktop.
if (requireNamespace(c("callr", "git2r"), quietly = TRUE)) {
has_git = git2r::in_repository()
if (has_git) {
message("Running `git2r::pull()` in the background.")
callr::r_bg(function() {git2r::pull()})$wait()$get_result()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment