update_version: Update NEWS.md and DESCRIPTION with a new version

View source: R/api-update-version.R

update_versionR Documentation

Update NEWS.md and DESCRIPTION with a new version

Description

Bumps a version component and adds to NEWS.md and DESCRIPTION.

Usage

update_version(which = "dev")

Arguments

which

Component of the version number to update. Supported values are "dev" (default), "patch", "minor" and "major".

Value

None

Examples

# Create mock package in a temporary directory.
# Set open to TRUE if you want to play in the mock package.
with_demo_project({
  # Use functions as if inside the newly created package project.
  # (Or go and actually run code inside the newly created package project!)
  # Add a new R file.
  usethis::use_r("cool-function", open = FALSE)
  # Pretend we added useful code inside it.
  # Track the new R file with Git.
  gert::git_add("R/cool-function.R")
  gert::git_commit("- Add cool function.")
  # Bump version with fledge.
  fledge::bump_version()
  fledge::update_news(c("- something I forgot", "- blabla"))
  fledge::update_version()
  gert::git_add("NEWS.md")
  gert::git_commit(message = "release notes tweaking")
  fledge::tag_version()
  print(fledge::get_last_tag())
})

fledge documentation built on July 9, 2023, 7:41 p.m.