refactor: update stand branches and support dot file
This commit is contained in:
@@ -17,7 +17,7 @@ module Feature
|
||||
feature_name = feature_words.join('-')
|
||||
feature_branch = "#{ENV['FEATURE_USER']||ENV['USER']}-#{current_branch}-#{feature_name}"
|
||||
|
||||
error "invalid base branch: #{current_branch}" unless standard_branches.include? current_branch or current_branch =~ /\d+\.\d+\.\d+/
|
||||
error "invalid base branch. must be one of: #{standard_branches.sort.join(', ')}" unless standard_branches.include? current_branch or current_branch =~ /\d+\.\d+\.\d+/
|
||||
error "invalid feature branch: #{feature_name}" if standard_branches.include? feature_name
|
||||
|
||||
git_fetch
|
||||
@@ -25,7 +25,7 @@ module Feature
|
||||
git_branch feature_branch
|
||||
git_checkout feature_branch
|
||||
git_push feature_branch
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -10,7 +10,14 @@ module Shared
|
||||
end
|
||||
|
||||
def standard_branches
|
||||
['master','release']
|
||||
defaults = ['master','release','main','develop']
|
||||
dot_file = ".git-utilities-rc"
|
||||
if File.exist? dot_file
|
||||
json = JSON.parse(File.read(dot_file))
|
||||
json['branches'] or defaults
|
||||
else
|
||||
defaults
|
||||
end
|
||||
end
|
||||
|
||||
def version_pattern
|
||||
|
||||
Reference in New Issue
Block a user