version

command module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2018 License: MPL-2.0 Imports: 9 Imported by: 0

README

version

go report Release

CLI command to verify versions and version constraints. The version is build based on hashicorp/go-version.

Versions used with go-version must follow SemVer.

Install

If you are OSX user, you can use Homebrew:

$ brew tap ivan-dyachenko/version
$ brew install version

For other operating systems check releases

Basic usage

version ">=1.0, <2.0" "1.7"
go version | version ">=1.9"

Usage in the bash scripts

version -b "..." returns true|false that can be used in bash scripts

Check git version by using pipeline:

#!/bin/bash

# version supports Pipeline (Unix)
if `git version | version -b ">2.15.0"`; then
  echo "git version > 2.15.0"
else
  echo "please install git > 2.15.0"
fi

Check gcc version:

#!/bin/bash

if `version -b ">=9.0.0" "$(gcc --version)"`; then
  echo "gcc version satisfies constraints >=9.0.0"
else
  echo "gcc version doesn't satisfies constraints >=9.0.0"
fi

Issues and Contributing

If you find an issue with this library, please report an issue. If you'd like, we welcome any contributions. Fork this library and submit a pull request.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL