R/check_unstaged.R

Defines functions check_unstaged

check_unstaged = function() {
  msg_start("Checking for uncommitted files...check_unstaged()")

  output = system2("git",
                   args = c("diff", "--name-only"),
                   stdout = TRUE)
  if (length(output) > 0L) {
    msg_warning("You have some unstaged files")
    msg_warning(output)
    msg_warning("It's worth commiting, then rerunning make final")
  } else {
    msg_success("Everything committed!")
  }
  return(invisible(TRUE))
}
jr-packages/jrNotes documentation built on Dec. 18, 2020, 11:07 p.m.