Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate --env options #278

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion 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
# Without this check, the --env option is duplicated each time
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 Down