Skip to content

Instantly share code, notes, and snippets.

@shadeslayer
Created May 18, 2017 14:36
Show Gist options
  • Save shadeslayer/7790e6ea3e199c895423d6a2b452299a to your computer and use it in GitHub Desktop.
Save shadeslayer/7790e6ea3e199c895423d6a2b452299a to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'octokit'
@client = Octokit::Client.new
repo = ARGV[1]
gh_repo = "KDE/#{repo}"
if @client.repository?(gh_repo)
@client.update_source_import(gh_repo, accept: 'application/vnd.github.barred-rock-preview')
else
@client.create_repository(repo, organization: 'KDE')
sleep 1 until @client.repository?(gh_repo)
@client.start_source_import(gh_repo, "git://anongit.kde.org/#{repo}", accept: 'application/vnd.github.barred-rock-preview')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment