Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/bumpPublic

bump bumps versions.

License

NotificationsYou must be signed in to change notification settings

lesiw/bump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bump bumps versions.

It accepts a version from standard input and prints the bumped version tostandard 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

curl

curl -L lesiw.io/bump| sh

go install

go install lesiw.io/bump@latest

Usage

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

Examples

# defaultecho"1.0.0"| bump# => 1.0.1echo"v1.2"| bump# => v1.3echo"version 42"| bump# => version 43# by indexecho"1.2.3"| bump -s 0# => 2.0.0echo"1.2.3"| bump -s 1# => 1.3.0echo"1.2.3"| bump -s 2# => 1.2.4, same as defaultecho"1.2.3"| bump -s 3# => 1.2.4-rc.1# semver aliasesecho"1.2.3"| bump -s major# => 2.0.0echo"1.2.3"| bump -s minor# => 1.3.0echo"1.2.3"| bump -s patch# => 1.2.4, same as defaultecho"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 tooverride 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, bumpthe 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}")"

[8]ページ先頭

©2009-2025 Movatter.jp