Namespace src/Version

src/Version

Overview

Directory src/Version

file source src/Version/checkMinimal.sh

Version::checkMinimal

Check that command version is greater than expected minimal version display warning if command version greater than expected minimal version display error if command version less than expected minimal version and exit 1

Arguments
  • $1 (commandName:String): command path
  • $2 (argVersion:String): command line parameters to launch to get command version
  • $3 (minimalVersion:String): expected minimal command version
  • $4 parseVersionCallback:Function
  • $5 (help:String): optional help message to display if command does not exist
Exit codes
  • 0: if command version greater or equal to expected minimal version
  • 1: if command version less than expected minimal version
  • 2: if command does not exist

src/Version/compare.sh

file source src/Version/compare.sh

Version::compare

compare 2 version numbers

Arguments
  • $1 (version1:String): version 1
  • $2 (version2:String): version 2
Exit codes
  • 0: if equal
  • 1: if version1 > version2
  • 2: else

src/Version/getCommandVersionFromPlainText.sh

file source src/Version/getCommandVersionFromPlainText.sh

Version::getCommandVersionFromPlainText

extract software version number

Arguments
  • $1 (command:String): the command that will be called with –version parameter
  • $2 (argVersion:String): allows to override default –version parameter

src/Version/githubApiExtractVersion.sh

file source src/Version/githubApiExtractVersion.sh

Version::githubApiExtractVersion

extract version number from github api

Function has no arguments.

Exit codes
  • 1: if jq or Version::parse fails
Input on stdin
  • json result of github API
Output on stdout
  • the version parsed
Requires
  • Linux::requireJqCommand

src/Version/parse.sh

file source src/Version/parse.sh

Version::parse

filter to keep only version number from a string

Arguments
  • (files:String[]): the files to filter
Exit codes
    • if one of the filter command fails
Input on stdin
  • you can use stdin as alternative to files argument
Output on stdout
  • the filtered content
Or, if you want, you can alternatively use the GitHub discussion Q&A for feedback and questions.