commit-messages: changed start to allow multiple words
This commit is contained in:
@@ -4,22 +4,24 @@ module Feature
|
|||||||
|
|
||||||
class Start < Feature::Base
|
class Start < Feature::Base
|
||||||
def valid?
|
def valid?
|
||||||
argv.size == 2
|
argv.size > 1
|
||||||
end
|
end
|
||||||
|
|
||||||
def help
|
def help
|
||||||
puts
|
puts
|
||||||
puts "USAGE: feature start feature_name"
|
puts "USAGE: feature start feature-words"
|
||||||
puts
|
puts
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
feature = argv[1]
|
subcommand, *feature_words = *argv
|
||||||
feature_branch = "#{ENV['USER']}-#{current_branch}-#{feature}"
|
|
||||||
|
|
||||||
error "invalid base branch: #{current_branch}" unless standard_branches.include? current_branch
|
feature_name = feature_words.join('-')
|
||||||
error "invalid feature branch: #{featureh}" if standard_branches.include? feature
|
feature_branch = "#{ENV['USER']}-#{current_branch}-#{feature_name}"
|
||||||
|
|
||||||
|
error "invalid base branch: #{current_branch}" unless standard_branches.include? current_branch
|
||||||
|
error "invalid feature branch: #{feature_name}" if standard_branches.include? feature_name
|
||||||
|
|
||||||
git_pull current_branch
|
git_pull current_branch
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user