GithubHelp home page GithubHelp logo

shell-semver's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

shell-semver's Issues

Incrementing does not follow semver spec.

An example will illustrate:

$ ./increment_version.sh -m 0.0.2  # Expected => 0.1.0
0.1.2  # <= Actual

The semver spec says:

Patch version MUST be reset to 0 when minor version is incremented.

Patch and minor version MUST be reset to 0 when major version is incremented.

This obviously has implications for the logic in the script. For example, if I request a bump of all three levels:

$ ./increment_version.sh -Mmp 1.2.3   # Expected => 2.1.1 (!?)

I doubt this is what anyone would want. Perhaps the options should be downward exclusive? So maybe if I request a Major version bump, the m and p options get ignored? I honestly don't know, but the current behavior is definitely incorrect.

Here's a proposed change:

if [ ! -z $major ]
then
  ((a[0]++))
  a[1]=0  # <= added
  a[2]=0  # <= added
fi

if [ ! -z $minor ]
then
  ((a[1]++))
  a[2]=0  # <= added
fi

if [ ! -z $patch ]
then
  ((a[2]++))
fi

Thanks.

Add invert support

When making release, I need to know in some scenarios previous version.

Please add -i (or similar) option support for inverse direction

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.