Commit 31f3e92f authored by Rajendra Kadam's avatar Rajendra Kadam

Add ff flag to force definition override

parent 45fff735
...@@ -14,9 +14,10 @@ module Gitlab ...@@ -14,9 +14,10 @@ module Gitlab
class_option :ee, type: :boolean, optional: true, default: false, desc: 'Indicates if event is for ee' class_option :ee, type: :boolean, optional: true, default: false, desc: 'Indicates if event is for ee'
class_option :category, type: :string, optional: false, desc: 'Category of the event' class_option :category, type: :string, optional: false, desc: 'Category of the event'
class_option :action, type: :string, optional: false, desc: 'Action of the event' class_option :action, type: :string, optional: false, desc: 'Action of the event'
class_option :ff, type: :boolean, optional: true, default: false, desc: 'Force definition override'
def create_event_file def create_event_file
raise 'Event definition already exists' if definition_exists? raise 'Event definition already exists' if definition_exists? && !force_definition_override?
template "event_definition.yml", file_path template "event_definition.yml", file_path
end end
...@@ -41,6 +42,10 @@ module Gitlab ...@@ -41,6 +42,10 @@ module Gitlab
options[:ee] options[:ee]
end end
def force_definition_override?
options[:ff]
end
private private
def definition_exists? def definition_exists?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment