Method: BigqueryMigration::CLI#_run

Defined in:
lib/bigquery_migration/cli.rb

#_run(config_path) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/bigquery_migration/cli.rb', line 41

def _run(config_path)
  opts = options.merge(
    dry_run: !options[:exec]
  )

  init_logger
  reopen_stdout
  reopen_stderr

  result = ActionRunner.new(config_path, opts).run
  open_output do |io|
    io.puts mask_secret(HashUtil.deep_stringify_keys(result).to_yaml)
    logger.info { "DRY-RUN has finished. Use --exec option to run." } if opts[:dry_run]
  end
  exit(1) unless result[:success]
end