merge-commit-and-feature: commit moved commit script as feature subcommand
This commit is contained in:
27
lib/feature/commit.rb
Normal file
27
lib/feature/commit.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
require_relative './base'
|
||||
|
||||
module Feature
|
||||
|
||||
class Commit < Feature::Base
|
||||
def valid?
|
||||
argv.size > 1
|
||||
end
|
||||
|
||||
def help
|
||||
puts
|
||||
puts "USAGE: feature commit [word....]"
|
||||
puts
|
||||
exit
|
||||
end
|
||||
|
||||
def execute
|
||||
parts = parse_branch(current_branch)
|
||||
|
||||
comment = argv.reject { |x| x == '-m' }.join(' ')
|
||||
comment = "#{parts[:feature]}: #{comment}"
|
||||
|
||||
git_commit comment
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user