https://github.com/cloudflare/semver_bash
Semantic Versioning in Bash
https://github.com/cloudflare/semver_bash
Last synced: 8 days ago
JSON representation
Semantic Versioning in Bash
- Host: GitHub
- URL: https://github.com/cloudflare/semver_bash
- Owner: cloudflare
- License: other
- Created: 2012-11-01T17:22:48.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T04:12:27.000Z (7 months ago)
- Last Synced: 2025-03-27T13:13:30.893Z (18 days ago)
- Language: Shell
- Size: 7.81 KB
- Stars: 253
- Watchers: 8
- Forks: 57
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-bash - semver_bash - Semantic Versioning in Bash. (Libraries / Testing)
README
semver_bash is a bash parser for semantic versioning
====================================================[Semantic Versioning](http://semver.org/) 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