lib/kafo/kafo_configure.rb in kafo-0.7.6 vs lib/kafo/kafo_configure.rb in kafo-0.8.0
- old
+ new
@@ -55,22 +55,28 @@
scenario_manager.check_enable_scenario
scenario_manager.check_disable_scenario
setup_config(config_file)
self.class.hooking.execute(:pre_migrations)
- reload_config
- applied_total = self.class.config.run_migrations
- request_config_reload if applied_total > 0
+ # run migrations
+ self.class.config.run_migrations
+
if ARGV.include?('--migrations-only')
self.class.verbose = (ARGV.include?('--verbose') || ARGV.include?('-v'))
Logger.setup
self.class.logger.info('Log buffers flushed')
self.class.exit(0)
end
- reload_config
+ # reload config
+ if @config_reload_requested
+ scenario_manager = setup_scenario_manager
+ self.class.scenario_manager = scenario_manager
+ setup_config(self.class.config_file)
+ self.class.logger.info('Installer configuration was reloaded')
+ end
if scenario_manager.configured?
scenario_manager.check_scenario_change(self.class.config_file)
if scenario_manager.scenario_changed?(self.class.config_file) && !self.class.in_help_mode?
prev_config = scenario_manager.load_configuration(scenario_manager.previous_scenario)
@@ -231,19 +237,9 @@
self.class.module_dirs = self.class.config.module_dirs
self.class.gem_root = self.class.config.gem_root
self.class.kafo_modules_dir = self.class.config.kafo_modules_dir
self.class.hooking.load
self.class.hooking.kafo = self
- end
-
- def reload_config
- if @config_reload_requested
- scenario_manager = setup_scenario_manager
- self.class.scenario_manager = scenario_manager
- setup_config(self.class.config_file)
- self.class.logger.info('Installer configuration was reloaded')
- @config_reload_requested = false
- end
end
def setup_scenario_manager
ScenarioManager.new((defined?(CONFIG_DIR) && CONFIG_DIR) || (defined?(CONFIG_FILE) && CONFIG_FILE))
end