lib/bones/main.rb in bones-2.0.1 vs lib/bones/main.rb in bones-2.0.2
- old
+ new
@@ -1,6 +1,6 @@
-# $Id: main.rb 579 2008-03-19 18:53:22Z tim_pease $
+# $Id$
require 'fileutils'
require 'optparse'
require 'erb'
@@ -113,19 +113,22 @@
begin
files_to_copy.each {|fn| cp fn}
pwd = File.expand_path(FileUtils.pwd)
- begin
- FileUtils.cd output_dir
- system "rake manifest:create 2>&1 > #{::Bones::DEV_NULL}"
- msg = "created '#{name}'"
- msg << " in directory '#{output_dir}'" if name != output_dir
- msg << "\nnow you need to fix these files"
- STDOUT.puts msg
- system "rake notes"
- ensure
- FileUtils.cd pwd
+ msg = "created '#{name}'"
+ msg << " in directory '#{output_dir}'" if name != output_dir
+ STDOUT.puts msg
+
+ if test(?f, File.join(output_dir, 'Rakefile'))
+ begin
+ FileUtils.cd output_dir
+ system "rake manifest:create 2>&1 > #{::Bones::DEV_NULL}"
+ STDOUT.puts "now you need to fix these files"
+ system "rake notes"
+ ensure
+ FileUtils.cd pwd
+ end
end
rescue Exception => err
FileUtils.rm_rf output_dir
msg = "could not create '#{name}'"
msg << " in directory '#{output_dir}'" if name != output_dir