mxw_wotlk_azerothcore/deps/semver_bash
mikx 44b1f31c23 ported double tracking from TC 2020-10-30 23:45:46 -04:00
..
.gitignore ported double tracking from TC 2020-10-30 23:45:46 -04:00
LICENSE ported double tracking from TC 2020-10-30 23:45:46 -04:00
README.md ported double tracking from TC 2020-10-30 23:45:46 -04:00
semver.sh ported double tracking from TC 2020-10-30 23:45:46 -04:00
semver_test.sh ported double tracking from TC 2020-10-30 23:45:46 -04:00

README.md

semver_bash is a bash parser for semantic versioning

Semantic Versioning is a set of guidelines that help keep version and version management sane. This is a bash based parser to help manage a project's versions. Use it from a Makefile or any scripts you use in your project.

Usage

semver_bash can be used from the command line as:

$ ./semver.sh "3.2.1" "3.2.1-alpha"  
3.2.1 -> M: 3 m:2 p:1 s:  
3.2.1-alpha -> M: 3 m:2 p:1 s:-alpha  
3.2.1 == 3.2.1-alpha -> 1.  
3.2.1 < 3.2.1-alpha -> 1.  
3.2.1 > 3.2.1-alpha -> 0.

Alternatively, you can source it from within a script:

. ./semver.sh  

local MAJOR=0  
local MINOR=0  
local PATCH=0  
local SPECIAL=""

semverParseInto "1.2.3" MAJOR MINOR PATCH SPECIAL  
semverParseInto "3.2.1" MAJOR MINOR PATCH SPECIAL