Git Product home page Git Product logo

incr's Introduction

incr
Incr is a tool to help you easily increment the version number of your NPM or Mix packages.

What does incr do?

The process is detailed as follow:

  • Find the relevant file(s) (e.g.: package.json and package-lock.json or mix.exs).
  • Determine the existing version number.
  • Increment the specified segment. If you increment the minor segment, the patch segment is set to 0 and the same goes for the major segment, the minor and patch segments are set to 0.
  • Write the newly incremented version number in the relevant file(s).
  • Create a new git commit with the relevant file with the version number as the default message (e.g.: 0.2.1).
  • Create a new git tag pointing to the new git commit with the version number prefixed by a 'v' as the name (e.g.: v0.2.1).
  • ๐Ÿ’ฅ

Installation

incr

~> gem install incr

Usage

To increment the patch segment of your NPM package version number:

~> incr npm patch

To increment the minor segment of your Mix package version number:

~> incr mix minor

Arguments

Here are some arguments that can be used with incr:

  • -d : Directory where to search for the version files (default: .)
  • -t : Tag name pattern, where %s will be replaced with the new version (default: v%s)
  • --[no-]commit : Commit changes. (default: enabled)
  • --[no-]tag : Create a git tag. (default: enabled)

Example:

~> incr --no-tag -d ./subprojects/web/ -t MyCustomTagPrefix/%s npm patch

This will :

  • Search for package.json and package-lock.json files inside ./subprojects/web/ and update the patch version
  • Commit the changes under the message MyCustomTagPrefix/2.3.4
  • Not create a tag with the new version

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jcouture/incr. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

The incr shield logo is based on this icon by blackspike, from the Noun Project. Used under a Creative Commons BY 3.0 license.

incr's People

Contributors

jcouture avatar marcantoinefortier avatar mbaron avatar madumo avatar remi avatar

Watchers

James Cloos avatar

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.