summaryrefslogtreecommitdiff
path: root/bin/changelog
diff options
context:
space:
mode:
Diffstat (limited to 'bin/changelog')
-rwxr-xr-xbin/changelog8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/changelog b/bin/changelog
index a0d1ad2d730..2cd337af778 100755
--- a/bin/changelog
+++ b/bin/changelog
@@ -12,6 +12,7 @@ Options = Struct.new(
:amend,
:author,
:dry_run,
+ :force,
:merge_request,
:title
)
@@ -29,6 +30,10 @@ class ChangelogOptionParser
options.amend = value
end
+ opts.on('-f', '--force', 'Overwrite an existing entry') do |value|
+ options.force = value
+ end
+
opts.on('-m', '--merge-request [integer]', Integer, 'Merge Request ID') do |value|
options.merge_request = value
end
@@ -111,8 +116,9 @@ class ChangelogEntry
def assert_new_file!
return unless File.exist?(file_path)
+ return if options.force
- fail_with "#{file_path} already exists!"
+ fail_with "#{file_path} already exists! Use `--force` to overwrite."
end
def assert_title!