release: added finish

This commit is contained in:
rkiel
2017-09-19 23:08:28 -04:00
parent f866ac6cec
commit 1b2f3c0194
2 changed files with 40 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ module Release
class Commander
COMMANDS = [
:finish,
:help,
:init,
:major,

39
lib/release/finish.rb Normal file
View File

@@ -0,0 +1,39 @@
require_relative './base'
module Release
class Finish < Release::Base
def valid?
argv.size == 1
end
def help
"release finish"
end
def execute
release_branch = current_branch
error "invalid release branch: #{release_branch}" unless release_branch =~ /\d+\.\d+\.\d+/
git_pull release_branch
git_local_tag release_branch
git_push release_branch
git_push_tags
git_checkout "master"
git_local_branch_delete release_branch
if remote_branch(release_branch) != ""
git_remote_branch_delete release_branch
end
git_prune
end
end
end