increase_NVIpkg_version: Increase the package version

View source: R/increase_NVIpkg_version.R

increase_NVIpkg_versionR Documentation

Increase the package version

Description

Increase the package version in the DESCRIPTION and NEWS files. As a default, the help and the reference manual will be styled and updated.

Usage

increase_NVIpkg_version(
  pkg = stringi::stri_extract_last_words(usethis::proj_path()),
  pkg_path = usethis::proj_path(),
  type = "develop",
  document = FALSE,
  ...
)

Arguments

pkg

[character(1)]
The package name. Defaults to stringi::stri_extract_last_words(usethis::proj_path()).

pkg_path

[character(1)]
The path to the package directory. Defaults to usethis::proj_path().

type

[character(1)]
The type of update to perform. Must be one of c("major", "minor" , "fix" , "develop" , "first"). Defaults to "develop".

document

[logical(1)]
Should styling be performed and documentation be updated. Defaults to FALSE.

...

Other arguments to be passed to document_NVIpkg.

Details

When publishing a new release, use type one of c("major", "minor", "fix"), depending of which release type it is.

When type = "first", the NEWS will be created with the template for the first release. If create_NVIpkg_skeleton has been used to create the package, the DESCRIPTION and NEWS files should already have been created with correct version number and NEWS template.

When type = "develop", the NEWS will be created with the template for the next release if the previous version was a release. If not, it increased the development version.

Value

None. Modifies NEWS and DESCRIPTION and eventually updates help.

Author(s)

Petter Hopp Petter.Hopp@vetinst.no

Examples

## Not run: 
# Modifies \code{NEWS} and \code{DESCRIPTION} with new version number.
# You need to be in a package directory at you PC for the code to work.
pkg <- stringi::stri_extract_last_words(usethis::proj_path())
pkg_path = usethis::proj_path()

NVIpackager::increase_NVIpkg_version(pkg = pkg,
                                     pkg_path = pkg_path,
                                     type = "develop")

# If you publish a new release, you want to ensure that documentation is up to date.
NVIpackager::increase_NVIpkg_version(pkg = pkg,
                                     pkg_path = pkg_path,
                                     type = "minor",
                                     document = TRUE)

## End(Not run)


PetterHopp/NVIpackager documentation built on Sept. 14, 2024, 1:24 a.m.