Skip to content

Commit

Permalink
Change place for fix to adding option
Browse files Browse the repository at this point in the history
  • Loading branch information
cllns committed Nov 27, 2024
1 parent df5fceb commit 9d8f28b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/hanami/cli/commands/app/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ module Environment
# @since 2.2.0
# @api private
def self.prepended(klass)
klass.option :env, desc: "App environment (development, test, production)", aliases: ["e"]
# This module is included each time the class is inherited from,
# but we only want to add this option once
unless klass.options.map(&:name).include?(:env)
klass.option :env, desc: "App environment (development, test, production)", aliases: ["e"]
end
end

# @since 2.0.0
Expand All @@ -51,7 +55,7 @@ def call(*args, **opts)
# @api private
def self.inherited(klass)
super
klass.prepend(Environment) unless klass.ancestors.include?(Environment)
klass.prepend(Environment)
end

# Returns the Hanami app class.
Expand Down

0 comments on commit 9d8f28b

Please sign in to comment.