Skip to content

Instantly share code, notes, and snippets.

@ticean
Created January 27, 2012 09:07
Show Gist options
  • Save ticean/1687883 to your computer and use it in GitHub Desktop.
Save ticean/1687883 to your computer and use it in GitHub Desktop.
Submodule cookbooks
#!/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