get_version: Retrieve the version number of a NEWS.md file

View source: R/get_version.R

get_versionR Documentation

Retrieve the version number of a NEWS.md file

Description

This function tries to extract the version number within a file. There are a few pitfalls:

* If the word "version" is within the text but denotes a dependency it is still detected. * If the files has a date before the version it will return the date instead of the version * It is assumed, that the NEWS.md files is updated from the top. Ergo the latest version is the first one.

Usage

get_version(file, latest = TRUE)

Arguments

file

a path to a file

latest

a Boolean, if TRUE (default) only the latest version is returned

Value

either a single string or a vector with version numbers


Dschaykib/newsmd documentation built on April 19, 2023, 12:38 p.m.