Skip to content

Instantly share code, notes, and snippets.

@linki
Created April 15, 2014 13:30
Show Gist options
  • Save linki/10732873 to your computer and use it in GitHub Desktop.
Save linki/10732873 to your computer and use it in GitHub Desktop.
require 'github_api'
require 'pry'
raise Exception, "provide your oauth token" if ARGV.empty?
def fetch_repos(github, org)
github.repos.list(org: org, type: 'all', auto_pagination: true).map(&:name)
end
def filter_plugins(repos)
repos.select{ |p| p =~ /\Aopenproject-/ }
end
oauth_token = ARGV.shift
github = Github.new(:oauth_token => oauth_token)
finn = filter_plugins(fetch_repos(github, 'finnlabs'))
opf = filter_plugins(fetch_repos(github, 'opf'))
finn.each do |p|
`git clone [email protected]:finnlabs/#{p}.git`
end
opf.each do |p|
`git clone [email protected]:opf/#{p}.git`
end
@linki
Copy link
Author

linki commented Apr 15, 2014

./openproject_plugins.rb <oauth_token>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment