diff --git a/doc/development/snowplow/event_dictionary_guide.md b/doc/development/snowplow/event_dictionary_guide.md index aae9ea43c78ed3643baea6676b79b67cbaaeff88..1640e884f3b5b67be6cf84bb2b02ee200ac8078b 100644 --- a/doc/development/snowplow/event_dictionary_guide.md +++ b/doc/development/snowplow/event_dictionary_guide.md @@ -86,7 +86,7 @@ The generator takes three options: - `--ee`: Indicates if the event is for EE. - `--category=CATEGORY`: Indicates the `category` of the event. - `--action=ACTION`: Indicates the `action` of the event. -- `--force`: Force flag to overwrite existing event definition. +- `--force`: Overwrite existing event definition, if one already exists. ```shell bundle exec rails generate gitlab:snowplow_event_definition --category Groups::EmailCampaignsController --action click diff --git a/lib/generators/gitlab/snowplow_event_definition_generator.rb b/lib/generators/gitlab/snowplow_event_definition_generator.rb index c58e34aa2360452d198318156ccd89d94c4ae624..497d0cd512ae89017be6ecd9a732be90f0f7c074 100644 --- a/lib/generators/gitlab/snowplow_event_definition_generator.rb +++ b/lib/generators/gitlab/snowplow_event_definition_generator.rb @@ -14,7 +14,7 @@ class SnowplowEventDefinitionGenerator < Rails::Generators::Base 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 :action, type: :string, optional: false, desc: 'Action of the event' - class_option :force, type: :boolean, optional: true, default: false, desc: 'Force definition override' + class_option :force, type: :boolean, optional: true, default: false, desc: 'Overwrite existing definition' def create_event_file raise "Event definition already exists at #{file_path}" if definition_exists? && !force_definition_override?