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