Method: Kafo::KafoConfigure#execute

Defined in:
lib/kafo/kafo_configure.rb

#executeObject



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/kafo/kafo_configure.rb', line 189

def execute
  parse_cli_arguments

  if !config.app[:verbose]
    @progress_bar = config.app[:colors] ? ProgressBars::Colored.new : ProgressBars::BlackWhite.new
  end

  if checks_only? || !skip_checks_i_know_better?
    logger = Logger.new('checks')
    if SystemChecker.check
      logger.notice("System checks passed")
    else
      logger.error("Your system does not meet configuration criteria")
      self.class.exit(:invalid_system)
    end
  end

  self.class.exit(0) if checks_only?

  self.class.hooking.execute(:pre_validations)
  if interactive?
    wizard = Wizard.new(self)
    wizard.run
  else
    unless validate_all
      puts "Error during configuration, exiting"
      self.class.exit(:invalid_values)
    end
  end

  self.class.hooking.execute(:pre_commit)
  unless dont_save_answers? || noop?
    config.configure_application
    store_params
    self.class.scenario_manager.link_last_scenario(self.class.config_file) if self.class.scenario_manager.configured?
  end
  run_installation
  return self
rescue SystemExit
  return self
end