Created
January 27, 2012 09:07
-
-
Save ticean/1687883 to your computer and use it in GitHub Desktop.
Submodule cookbooks
This file contains 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
#!/usr/bin/env ruby | |
# A lil' snip to submodule cookbooks in bulk. | |
require 'rubygems' | |
require 'octokit' | |
github_org = 'guidance-cookbooks' | |
Octokit.repositories(github_org).each do |repo| | |
unless File.exists?(File.join(File.dirname(__FILE__), "cookbooks", repo.name)) | |
cmd = "git submodule add #{repo.git_url} cookbooks/#{repo.name}" | |
puts cmd | |
#sh cmd | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment