increment_version: Increment version field

Description Usage Arguments Value Examples

View source: R/increment_version.R

Description

Increment the version field. "Major", "minor" and "patch" fields are set as integers. Fields of lower precedence are reset to default value (0L)

Usage

1
2
3
4
5
6
7
8
increment_version(x, field, value, ...)

## S3 method for class 'svptr'
increment_version(x, field = c("major", "minor", "patch"),
  value, ...)

## S3 method for class 'svlist'
increment_version(x, field, value, ...)

Arguments

x

An object of class "svlist" or "svptr".

field

For the "svptr" class a character string detailing the field to set (major, minor etc...). For the "svlist" class a character vector detailing the field to set for each list member.

value

The value to increment the field by. For fields "major", "minor" and "patch" this is an integer. For the "svptr" class value is a scalar. For the "svlist" class value is an integer vector detailing the value to increment by for each list member.

...

Additional arguments passed on to methods.

Value

returns an object of class svptr or svlist

Examples

1
2
3
4
5
6
semver <- parse_version(c("1.2.3", "1.2.4-alpha+bld1"))
increment_version(semver[[2]], "major", 1L)
increment_version(semver[[2]], "major", -1L)
increment_version(semver, c("minor", "patch"), c(3L, 9L))
increment_version(semver, c("minor", "patch"), c(-1L, -3L))
increment_version(semver, c("minor"), 1L)

semver documentation built on May 2, 2019, 5:53 a.m.