diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-03-27 16:06:31 +0100 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-03-27 16:06:31 +0100 |
commit | 1f73dac0c3511830335613baddc4cbbb70c89d31 (patch) | |
tree | c13f62feba66dfdcfb8bf9eea23dd294adb89561 | |
parent | c628f8f42651a74462eddd71ab53bd1784f9a8bf (diff) | |
download | gitlab-ce-44488-open-editor-when-creating-a-new-changelog-entry.tar.gz |
Opens specified text editor when creating a new changelog entry44488-open-editor-when-creating-a-new-changelog-entry
-rwxr-xr-x | bin/changelog | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/changelog b/bin/changelog index 9b60f53ce40..0ad5265aecb 100755 --- a/bin/changelog +++ b/bin/changelog @@ -140,6 +140,10 @@ class ChangelogEntry write amend_commit if options.amend end + + if editor + system("#{editor} '#{file_path}'") + end end private @@ -158,6 +162,10 @@ class ChangelogEntry File.write(file_path, contents) end + def editor + ENV['EDITOR'] + end + def amend_commit %x{git add #{file_path}} exec("git commit --amend") |