Created
April 15, 2014 13:30
-
-
Save linki/10732873 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./openproject_plugins.rb <oauth_token>