summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-11-03 10:07:13 +0000
committerRémy Coutable <remy@rymai.me>2016-11-03 10:07:13 +0000
commitca1096e77f1f44089cd8e37e2fe7fa392571542f (patch)
tree0041e7c7ccb3148df0225177abe972feb4093a07 /bin
parentd9cf5c0adc23bc121af27bac4f790fa4a11bae6d (diff)
parent895673733a5712ee4b69c84195a1d717a72fc032 (diff)
downloadgitlab-ce-ca1096e77f1f44089cd8e37e2fe7fa392571542f.tar.gz
Merge branch 'rs-changelog-force' into 'master'
Add a `--force` option to bin/changelog See merge request !7252
Diffstat (limited to 'bin')
-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!