Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

Commit

Permalink
initial stab at it
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewland committed May 17, 2011
1 parent e0c7fb0 commit 9dbbcf3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Rakefile
@@ -0,0 +1,33 @@
task :submodule do
git "submodule update --init"
end

require 'rake/clean'
CLEAN.include('tmp/*')

def git(command)
system %{git #{command}}
end

cookbook_list = FileList['cookbooks/*'].map do |cookbook_path|

if File.directory?(cookbook_path)
cookbook = cookbook_path.split("/").last
desc "cook #{cookbook}"
file "tmp/#{cookbook}" do
git "clone --no-hardlinks cookbooks tmp/#{cookbook}"
Dir.chdir("#{Rake.original_dir}/tmp/#{cookbook}")
git "filter-branch --subdirectory-filter #{cookbook} HEAD"
git "reset --hard"
git "gc --aggressive"
git "prune"
Dir.chdir(Rake.original_dir)
end

cookbook
end
end.reject { |c| c.nil? }

task :default do
cookbook_list.each { |cookbook| Rake::Task["tmp/#{cookbook}"].invoke }
end
2 changes: 2 additions & 0 deletions tmp/.gitignore
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 9dbbcf3

Please sign in to comment.