未验证 提交 83106427 编写于 作者: T Tiago Botelho 提交者: Rémy Coutable

Opens specified text editor when creating a new changelog entry

Signed-off-by: NRémy Coutable <remy@rymai.me>
上级 82852058
......@@ -148,7 +148,7 @@ class ChangelogEntry
def execute
assert_feature_branch!
assert_title!
assert_title! unless editor
assert_new_file!
# Read type from $stdin unless is already set
......@@ -162,6 +162,10 @@ class ChangelogEntry
write
amend_commit if options.amend
end
if editor
system("#{editor} '#{file_path}'")
end
end
private
......@@ -180,6 +184,10 @@ class ChangelogEntry
File.write(file_path, contents)
end
def editor
ENV['EDITOR']
end
def amend_commit
fail_with "git add failed" unless system(*%W[git add #{file_path}])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册