class Travis::CLI::RepoCommand

def confirm_and_save_travis_config(confirm = true, _file = travis_yaml)

def confirm_and_save_travis_config(confirm = true, _file = travis_yaml)
  if confirm
    ans = ask [
      nil,
      color("Overwrite the config file #{travis_yaml} with the content below?", %i[info yellow]),
      color('This reformats the existing file.', %i[info red]),
      travis_config.to_yaml,
      color('(y/N)', %i[info yellow])
    ].join("\n\n")
    proceed = ans =~ /^y/i
  else
    proceed = true
  end
  save_travis_config if proceed
end