Performs functions surrounding versioning within packages.

  • Get_Version(dir) will extract the current version from the DESCRIPTION file in dir.

  • Set_Version(dir,Version) will update the DESCRIPTION file in dir.

  • Add_Version(Version,type) will increment the version based on the level provided (major, minor, patch or dev).

  • Update_Version(type) Gets, Adds and Sets a new Version Update based on the type of the update.

  • Check_Version(Version) Checks if Version is appropriately named version.

  • Github_Version_match(user,repo,ref,dir) extracts the current version of the github repo, and sets the current version to match. Looks for DESCRIPTION at the address:"https://raw.githubusercontent.com/<user>/<repo>/<ref>/"

Get_Version(dir = ".")

Set_Version(dir = ".", Version)

Add_Version(Version, type)

Update_Version(dir = ".", type = "dev")

Check_Version(Version)

Match_Version_Github(
  user = NULL,
  repo = NULL,
  ref = "main",
  git_dir = NULL,
  dir = "."
)

Arguments

dir

directory containing the DESCRIPTION file. Can also be a web address, such as a github repo

Version

an appropriate vector for version numbers. Must be of length 4 and the elements mst be named "major", "minor", "patch" and "dev", respectively

type

accepts "major", "minor", "patch", "dev" or "none" to describe what kind of update to perform. whichever type is supplied will be the level that is incremented. All lower levels will be reset to 0 (or 9000 for dev).

user

username for Github lookup

repo

repository for Github lookup. If NULL, will extract the package name from the DESCRIPTION file

ref

the branch to use as a lookup. Defaults to "master"

git_dir

directory for the github repo. Can be found by using