Permalink
Browse files

Added a rake task to generate a new project using this project as a t…

…emplate
  • Loading branch information...
1 parent eae3603 commit 789d2edc6529eb246ae62542d1dce5fa192934e0 Mohan Zhang committed with Adam Stacoviak Sep 9, 2010
Showing with 12 additions and 0 deletions.
  1. +3 −0 Rakefile
  2. +9 −0 tasks/generate.rake
View
@@ -0,0 +1,3 @@
+require 'rake'
+
+Dir["tasks/*.rake"].sort.each { |ext| load ext }
View
@@ -0,0 +1,9 @@
+desc 'Start a new project (specify DIR)'
+task :generate do
+ puts "Invalid directory" unless File.exists?(ENV['DIR'])
+
+ sh "git archive HEAD | (cd #{ENV['DIR']} && tar -xvf -)"
+
+ # remove this rake task from the new project
+ sh "cd #{ENV['DIR']}; rm #{File.join("tasks", "generate.rake")}"
+end

0 comments on commit 789d2ed

Please sign in to comment.