R/check-package-version.R

#' Function for checking current package version.
#' (Read the version number in DESCRIPTION file.)
#' @param packageLocation The path of the package.
#'
#' @export
#'

checkPackageVersion <- function(packageLocation = "."){
  # Read DESCRIPTION file --->
  desc <- readLines(file.path(packageLocation, "DESCRIPTION"))

  # Find the line where the version is defined
  vLine <- grep("^Version\\:", desc)

  # Extract version number
  version_number <- gsub("^Version\\:\\s*", "", desc[vLine])

  return(version_number)
}
Teresa00/hfmAnnotation documentation built on May 14, 2019, 12:51 a.m.