From c9e290bcc625e6f75ac2c31a183bed18540cf239 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 28 May 2024 10:34:53 -0400 Subject: [PATCH] automatically run migrations --- lib/inferno/apps/cli/main.rb | 2 ++ lib/inferno/apps/cli/migration.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/inferno/apps/cli/main.rb b/lib/inferno/apps/cli/main.rb index a09477309..c4df15e97 100644 --- a/lib/inferno/apps/cli/main.rb +++ b/lib/inferno/apps/cli/main.rb @@ -11,6 +11,7 @@ module CLI class Main < Thor desc 'console', 'Start an interactive console session with Inferno' def console + Migration.new.run(Logger::INFO) Console.new.run end @@ -25,6 +26,7 @@ def migrate type: :boolean, desc: 'Automatically restart Inferno when a file is changed.' def start + Migration.new.run(Logger::INFO) command = 'foreman start --env=/dev/null' if `gem list -i foreman`.chomp == 'false' puts "You must install foreman with 'gem install foreman' prior to running Inferno." diff --git a/lib/inferno/apps/cli/migration.rb b/lib/inferno/apps/cli/migration.rb index 81dc4e26a..b4094f2fd 100644 --- a/lib/inferno/apps/cli/migration.rb +++ b/lib/inferno/apps/cli/migration.rb @@ -3,9 +3,9 @@ module Inferno module CLI class Migration - def run + def run(log_level = Logger::DEBUG) Inferno::Application.start(:logging) - Inferno::Application['logger'].level = Logger::DEBUG + Inferno::Application['logger'].level = log_level Utils::Migration.new.run end