R/api-update-version.R

Defines functions check_which update_version

Documented in update_version

#' Update NEWS.md and DESCRIPTION with a new version
#'
#' Bumps a version component and adds to `NEWS.md` and `DESCRIPTION`.
#'
#' @example man/examples/tag-version.R
#'
#' @return None
#' @export
update_version <- function(which = "dev") {
  check_which(which)
  update_version_impl(which)
  invisible(NULL)
}

#' @rdname update_version
#' @usage NULL
#' @aliases NULL
check_which <- function(which) {
  #' @param which Component of the version number to update. Supported
  #'   values are `"dev"` (default), `"patch"`, `"minor"` and `"major"`.
  stopifnot(
    is.character(which), length(which) == 1, !is.na(which),
    which %in% c("dev", "patch", "minor", "major")
  )
}

Try the fledge package in your browser

Any scripts or data that you put into this service are public.

fledge documentation built on May 29, 2024, 8:59 a.m.