bump_pkg_version: Bump the version of a package

View source: R/bump_pkg_version.R

bump_pkg_versionR Documentation

Bump the version of a package

Description

Use bump_pkg_version() to bump the version of a package.

Usage

bump_pkg_version(pkgpath=".", update.Date=FALSE)

Arguments

pkgpath

The path (as a single string) to the top-level directory of an R package source tree.

update.Date

TRUE or FALSE. If TRUE then the Date field (if present) gets updated to the current date.

Value

An invisible NULL.

See Also

  • updatePackageObjects which uses bump_pkg_version internally when bump.Version=TRUE.

  • git_commit for an example.

Examples

## Create dummy R package:
create_dummy_pkg <- function(desc, pkgpath) {
    dir.create(pkgpath)
    descpath <- file.path(pkgpath, "DESCRIPTION")
    write.dcf(rbind(desc), descpath)
    descpath
}

pkgname <- "Dummy"
desc <- c(
    Package=pkgname,
    Title="Not a real package",
    Description="I'm not real u know.",
    Version="3.0.9",
    Date="1969-07-20"
)
pkgpath <- file.path(tempdir(), pkgname)
descpath <- create_dummy_pkg(desc, pkgpath)

## Bump its Version:
bump_pkg_version(pkgpath)
cat(readLines(descpath), sep="\n")

## Bump its Version again and set Date to current date:
bump_pkg_version(pkgpath, update.Date=TRUE)
cat(readLines(descpath), sep="\n")

## Throw it away:
unlink(pkgpath, recursive=TRUE)

Bioconductor/updateObject documentation built on Oct. 30, 2024, 12:15 p.m.