release: cleanup init
This commit is contained in:
@@ -24,6 +24,20 @@ module Release
|
|||||||
puts
|
puts
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def validate_version_format (version)
|
||||||
|
error "invalid version number format: #{version}" unless version =~ /\d+\.\d+\.\d+/
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate_version_is_new (version)
|
||||||
|
error "version already exists: #{git_local_list_tags.join(' ')}" if git_local_list_tags.include? "v#{version}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate_current_branch_master
|
||||||
|
error "invalid starting branch: #{current_branch}" unless standard_branches.include? current_branch
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ module Release
|
|||||||
def execute
|
def execute
|
||||||
subcommand, version, *extras = *argv
|
subcommand, version, *extras = *argv
|
||||||
|
|
||||||
error "invalid version: #{version}" unless version =~ /\d+\.\d+\.\d+/
|
validate_version_format version
|
||||||
error "existing version: #{git_local_list_tags.join(' ')}" if git_local_list_tags.include? "v#{version}"
|
validate_version_is_new version
|
||||||
error "invalid base branch: #{current_branch}" unless standard_branches.include? current_branch
|
validate_current_branch_master
|
||||||
|
|
||||||
git_pull current_branch
|
git_pull current_branch
|
||||||
|
|
||||||
# git_local_tag version
|
git_local_tag version
|
||||||
|
|
||||||
git_push_tags
|
git_push_tags
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user