All Projects → davidrjonas → semver-cli

davidrjonas / semver-cli

Licence: MIT license
semver-cli is a simple command line tool to compare and manipulate version strings.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to semver-cli

Macos Downloader
Command line tool for downloading macOS installers and beta updates
Stars: ✭ 162 (+478.57%)
Mutual labels:  commandline
Radare2
UNIX-like reverse engineering framework and command-line toolset
Stars: ✭ 15,412 (+54942.86%)
Mutual labels:  commandline
semver-explain
Explain semver requirements by converting them into less than, greater than, and/or equal to form.
Stars: ✭ 27 (-3.57%)
Mutual labels:  semver
You Dont Need Gui
Stop relying on GUI; CLI **ROCKS**
Stars: ✭ 4,766 (+16921.43%)
Mutual labels:  commandline
Yadm
Yet Another Dotfiles Manager
Stars: ✭ 2,982 (+10550%)
Mutual labels:  commandline
Ace
Node.js framework for creating command line applications
Stars: ✭ 233 (+732.14%)
Mutual labels:  commandline
Comfy Table
🔶 Build beautiful terminal tables with automatic content wrapping
Stars: ✭ 156 (+457.14%)
Mutual labels:  commandline
xavtool
Xplat Automating Version Tool
Stars: ✭ 33 (+17.86%)
Mutual labels:  semver
Gitlab Cli
Create a merge request from command line in gitlab
Stars: ✭ 224 (+700%)
Mutual labels:  commandline
flagsmith
Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
Stars: ✭ 2,309 (+8146.43%)
Mutual labels:  cd
Psfzf
A PowerShell wrapper around the fuzzy finder fzf
Stars: ✭ 187 (+567.86%)
Mutual labels:  commandline
Winfetch
🛠 A command-line system information utility written in PowerShell. Like Neofetch, but for Windows.
Stars: ✭ 189 (+575%)
Mutual labels:  commandline
Tv Overlord
TV Overlord — Download and manage tv shows:
Stars: ✭ 242 (+764.29%)
Mutual labels:  commandline
Reactopt
A CLI React performance optimization tool that identifies potential unnecessary re-rendering
Stars: ✭ 1,975 (+6953.57%)
Mutual labels:  commandline
git-version-bumper
Bump your git tag to the next version, easily. 👊
Stars: ✭ 92 (+228.57%)
Mutual labels:  semver
Joincap
Merge multiple pcap files together, gracefully.
Stars: ✭ 159 (+467.86%)
Mutual labels:  commandline
Functional intro to python
[tutorial]A functional, Data Science focused introduction to Python
Stars: ✭ 228 (+714.29%)
Mutual labels:  commandline
release-changelog-builder-action
A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
Stars: ✭ 515 (+1739.29%)
Mutual labels:  cd
todo-cli
✅ Command-line tool to manage Todo lists
Stars: ✭ 88 (+214.29%)
Mutual labels:  commandline
Kunst
Download and display album art or display embedded album art
Stars: ✭ 242 (+764.29%)
Mutual labels:  commandline

semver-cli

Build Status Go Report Card

semver-cli is a simple command line tool to compare and manipulate version strings.

It is basically a cli wrapper around the excellent Masterminds semver library, with lots of help from the also excellent Kingpin

usage: semver [<flags>] <command> [<args> ...]

Command-line semver tools. On error, print to stderr and exit -1.

Flags:
      --help     Show context-sensitive help (also try --help-long and --help-man).
  -v, --verbose  Verbose mode.

Commands:
  help [<command>...]
    Show help.

  satisfies <VERSION> <CONSTRAINTS>
    Test if a version satisfies a constraint. Exit 0 if satisfies, 1 if not. If verbose, print an explanation to stdout.

  greater <A> <B>
    Compare two versions. Exit 0 if the first is greater, 1 if not. If verbose, print greater to stdout.

  lesser <A> <B>
    Compare two versions. Exit 0 if the first is lesser, 1 if not. If verbose, print lesser to stdout.

  equal <A> <B>
    Compare two versions. Exit 0 if they are equal, 1 if not.

  inc <COMPONENT> <VERSION>
    Increment major, minor, or patch component.

  get <COMPONENT> <VERSION>
    Get major, minor, patch, prerelease or metadata component.

  set <COMPONENT> <VERSION> <VALUE>
    Set prerelease or metadata component.

Example

Deploy only when the CI tag is within constraints and is greater than what is currently released. For example, with constraints 1.* and a released version of 1.4, a version of 1.5 would be released but a version of 2.0 or 1.2 would not.

#!/bin/bash

CONSTRAINTS=$(jq .labels.constraints manifest.json)
RELEASED=$(jq .image manifest.json | cut -d: -f 2)

semver satisfies "$CI_TAG" "$CONSTRAINTS" || exit 1
semver greater   "$CI_TAG" "$RELEASED"    || exit 1

deploy
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].