tag-versions
A command line tool, installed globally on build that wrapps omichelsen/compare-versions
for use in our CircleCI 2.0 build containers.
Requirements
This module requires a minimum of Node v6.9.0.
Getting Started
To begin, you'll need to install tag-versions
:
$ npm i -g @webpack-contrib/tag-versions --save-dev
Wraps compare-versions to perform semver comparisons on libraries dist-tags consumable from a simple bash script( see below ).
CLI
$ compver --name webpack --gte next --lt latest
Options
--name The name of the pacakge to compare.
--gte The dist-tag used in the left side of the comparison.
--lt The dist-tag used in the right side of the comparison.
Intended usage
$ if [[ $(compver --name webpack --gte next --lt latest) < 1 ]] ; then echo n00p; else npm run test ; fi
Examples
$ compver --name superLib --gte '10.1.8' --lt '10.0.4' // outputs 1
$ compver --name superLib --gte '10.0.8' --lt '10.0.8' // outputs 0
$ compver --name superLib --gte '10.1.1' --lt '10.2.2' // outputs -1