diff --git a/lib/hanami/cli/commands/app/db/command.rb b/lib/hanami/cli/commands/app/db/command.rb index 3c895484..890b497a 100644 --- a/lib/hanami/cli/commands/app/db/command.rb +++ b/lib/hanami/cli/commands/app/db/command.rb @@ -179,6 +179,9 @@ def re_run_development_command_in_test # Re-runs in test are for development-env commands only. return unless Hanami.env == :development + # Re-runs have been intentionally switched off + return if ENV.fetch("HANAMI_CLI_DB_COMMAND_RE_RUN_IN_TEST", "true") != "true" + cmd = $0 cmd = "bundle exec #{cmd}" if ENV.key?("BUNDLE_BIN_PATH") @@ -192,7 +195,7 @@ def re_run_development_command_in_test end def re_running_in_test? - ENV.key?("HANAMI_CLI_DB_COMMAND_RE_RUN_IN_TEST") + ENV["HANAMI_CLI_DB_COMMAND_RE_RUN_IN_TEST"] == "true" end # Returns the `ARGV` with every option argument included, but the `-e` or `--env` args