Learn R Programming

SpaDES.core (version 3.0.4)

getModuleVersion: Find the latest module version from a SpaDES module repository

Description

Modified from https://stackoverflow.com/a/25485782/1380598.

Usage

getModuleVersion(
  name,
  repo,
  token,
  moduleFiles = NULL,
  verbose = getOption("reproducible.verbose")
)

# S4 method for character,character getModuleVersion( name, repo, token, moduleFiles = NULL, verbose = getOption("reproducible.verbose") )

# S4 method for character,missing getModuleVersion( name, token, moduleFiles = NULL, verbose = getOption("reproducible.verbose") )

Value

numeric_version

Arguments

name

Character string giving the module name.

repo

GitHub repository name, specified as "username/repo". Default is "PredictiveEcology/SpaDES-modules", which is specified by the global option spades.moduleRepo. Only master/main branches can be used at this point.

token

A github repository token as from gitcreds::gitcreds_get()

moduleFiles

Optional. List of files of the name and repo. If not supplied, this function will get that information by using checkModule.

verbose

Numeric, -1 silent (where possible), 0 being very quiet, 1 showing more messaging, 2 being more messaging, etc. Default is 1. Above 3 will output much more information about the internals of Caching, which may help diagnose Caching challenges. Can set globally with an option, e.g., options('reproducible.verbose' = 0) to reduce to minimal

Author

Alex Chubaty

Details

getModuleVersion extracts a module's most recent version by looking at the module .zip files contained in the module directory. It takes the most recent version, based on the name of the zip file.

See the modules vignette for details of module directory structure (https://spades-core.predictiveecology.org/articles/ii-modules.html#module-directory-structure-modulename), and see our SpaDES-modules repo for details of module repository structure (https://github.com/PredictiveEcology/SpaDES-modules).

See Also

zipModule() for creating module .zip folders.