Fix bad write mode on Rakefile during install

This commit is contained in:
ragaskar 2010-01-26 20:20:49 -08:00
parent 53305edc68
commit 0b02e82229
1 changed files with 9 additions and 6 deletions

View File

@ -40,14 +40,17 @@ if ARGV[0] == 'init'
copy_unless_exists('spec/javascripts/support/sources-rails.yaml', 'spec/javascripts/support/sources.yaml') copy_unless_exists('spec/javascripts/support/sources-rails.yaml', 'spec/javascripts/support/sources.yaml')
else else
copy_unless_exists('spec/javascripts/support/sources.yaml') copy_unless_exists('spec/javascripts/support/sources.yaml')
write_mode = 'w'
if File.exist?(dest_path('Rakefile')) if File.exist?(dest_path('Rakefile'))
load dest_path('Rakefile') load dest_path('Rakefile')
write_mode = 'a'
end end
write_mode = Rake::Task.task_defined?('jasmine') ? 'a' : 'w' unless Rake::Task.task_defined?('jasmine')
File.open(dest_path('Rakefile'), write_mode) do |f| File.open(dest_path('Rakefile'), write_mode) do |f|
f.write(File.read(template_path('lib/tasks/jasmine.rake'))) f.write(File.read(template_path('lib/tasks/jasmine.rake')))
end end
end end
end
File.open(template_path('INSTALL'), 'r').each_line do |line| File.open(template_path('INSTALL'), 'r').each_line do |line|
puts line puts line
end end