Giter Club home page Giter Club logo

bump's Introduction

bump

bump bumps versions.

It accepts a version from standard input and prints the bumped version to standard output.

bump is:

  • A small, unix-like utility, designed for use in build scripts.
  • Compatible with semantic versioning, but does not require it.
  • Agnostic to version prefixes, like "v".

Installation

> bump curl -L https://github.com/lesiw/bump/releases/latest/download/bump-`uname -s`-`uname -m`
sudo install bump /usr/local/bin/bump

Usage

Usage of bump:
  -s string
        index of segment to bump

Examples

# default
echo "1.0.0" | bump      # => 1.0.1
echo "v1.2" | bump       # => v1.3
echo "version 42" | bump # => version 43

# by index
echo "1.2.3" | bump -s 0 # => 2.0.0
echo "1.2.3" | bump -s 1 # => 1.3.0
echo "1.2.3" | bump -s 2 # => 1.2.4, same as default
echo "1.2.3" | bump -s 3 # => 1.2.4-rc.1

# semver aliases
echo "1.2.3" | bump -s major # => 2.0.0
echo "1.2.3" | bump -s minor # => 1.3.0
echo "1.2.3" | bump -s patch # => 1.2.4, same as default
echo "1.2.3" | bump -s pre   # => 1.2.4-rc.1

Cookbook

Change default segment to bump

By default, bump will bump the rightmost segment. The idiomatic way to override this behavior is with an alias.

alias bump='bump -s 1' # bump the minor segment by default

Bump git tag

git tag "$(git describe --abbrev=0 --tags | bump)"
git push origin --tags

Bump tag based on latest commit keyword

If +major, +minor, +patch, or +pre are in the most recent commit, bump the version according to the keyword, otherwise bump the patch segment.

SEGMENT=$(git show -s --format=%s | awk -F'+' 'BEGIN{RS=" "} /\+/ {print $2}')
git tag "$(git describe --abbrev=0 --tags | bump -s "${SEGMENT:-patch}")"

bump's People

Contributors

booniepepper avatar lesiw avatar

Watchers

 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.