class Travis::CLI::Setup::Releases

def github

def github
  @github ||= begin
    load_gh
    Tools::Github.new(session.config['github']) do |g|
      g.drop_token    = false
      g.ask_login     = proc { ask("Username: ") }
      g.ask_password  = proc { |user| ask("Password for #{user}: ") { |q| q.echo = "*" } }
      g.ask_otp       = proc { |user| ask("Two-factor authentication code for #{user}: ") }
      g.debug         = proc { |log| debug(log) }
      g.after_tokens  = proc { g.explode = true and error("no suitable github token found") }
      g.scopes        = org? ? ['public_repo'] : ['repo']
      g.note          = "automatic releases for #{repository.slug}"
    end
  end
end