Skip to content

Commit

Permalink
Merge pull request #109 from jasonwbarnett/jwb/add-commit_message-option
Browse files Browse the repository at this point in the history
Add commit_message option to rake task
  • Loading branch information
grosser authored Nov 25, 2020
2 parents 73c2061 + dfe3a2f commit 780a398
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ require "bump/tasks"
rake bump:patch TAG=true TAG_PREFIX=v- # tag with a prefix 'v-' ex. the tag will look like v-0.0.1
rake bump:patch COMMIT=false TAG=false # don't commit, don't tag
rake bump:minor BUNDLE=false # don't run `bundle`
rake bump:minor COMMIT_MESSAGE="release it" # custom commit message, appended to version

## Ruby

Expand Down
1 change: 1 addition & 0 deletions lib/bump/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
tag: ENV['TAG'],
tag_prefix: ENV['TAG_PREFIX'],
commit: ENV['COMMIT'],
commit_message: ENV['COMMIT_MESSAGE'],
bundle: ENV['BUNDLE'],
increment: ENV['INCREMENT']
}
Expand Down
7 changes: 7 additions & 0 deletions spec/bump/tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
`git log -1 --pretty=format:'%s'`.should == "v1.3.0"
end

it "appends custom commit message" do
output = run "COMMIT_MESSAGE='release' rake bump:minor"
output.should include("1.3.0")
read("VERSION").should == "1.3.0\n"
`git log -1 --pretty=format:'%s'`.should == "v1.3.0 release"
end

it "fails when it cannot bump" do
write "VERSION", "AAA"
run "rake bump:minor", fail: true
Expand Down

0 comments on commit 780a398

Please sign in to comment.