Git 'dashed' commands are deprecated and no longer available with new installs from...
[git-blog.git] / Rakefile.rb
blobcf486108a87e9373fe56665a1bb9640e4d4a7155
1 require 'rubygems'
2 require 'fileutils'
3 include FileUtils
5 $:.unshift File.expand_path('./lib')
6 require 'git-blog/core'
8 desc 'Create a new git-blog'
9 task :create, :destination do |_, params|
10   destination = params[:destination].nil? ? './blog' : params[:destination]
11   destination = File.expand_path destination
12   
13   mkdir destination rescue nil
14   File.open destination/:Rakefile.rb, File::RDWR|File::TRUNC|File::CREAT do |rakefile|
15     rakefile.puts "$:.unshift File.expand_path('#{GitBlog::Scope / :lib}')"
16     rakefile.puts "require 'git-blog'"
17     rakefile.print "\n"; rakefile.close
18   end
19   puts "** git-blog created at #{destination}!"
20   puts "** now `cd #{destination}` and `rake initialize`!"
21 end