View source: R/bump_pkg_version.R
bump_pkg_version | R Documentation |
Use bump_pkg_version()
to bump the version of a package.
bump_pkg_version(pkgpath=".", update.Date=FALSE)
pkgpath |
The path (as a single string) to the top-level directory of an R package source tree. |
update.Date |
|
An invisible NULL
.
updatePackageObjects
which uses
bump_pkg_version
internally when bump.Version=TRUE
.
git_commit
for an example.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.