Permalink
Browse files

Fix bad write mode on Rakefile during install

  • Loading branch information...
1 parent 53305ed commit 0b02e822298b7c7a6b7cb58e5370decefc77e0ff @ragaskar ragaskar committed Jan 27, 2010
Showing with 9 additions and 6 deletions.
  1. +9 −6 bin/jasmine
View
@@ -20,8 +20,8 @@ end
def copy_unless_exists(relative_path, dest_path = nil)
unless File.exist?(dest_path(relative_path))
- File.copy(template_path(relative_path), dest_path(dest_path || relative_path))
- end
+ File.copy(template_path(relative_path), dest_path(dest_path || relative_path))
+ end
end
if ARGV[0] == 'init'
@@ -40,13 +40,16 @@ if ARGV[0] == 'init'
copy_unless_exists('spec/javascripts/support/sources-rails.yaml', 'spec/javascripts/support/sources.yaml')
else
copy_unless_exists('spec/javascripts/support/sources.yaml')
+ write_mode = 'w'
if File.exist?(dest_path('Rakefile'))
load dest_path('Rakefile')
+ write_mode = 'a'
+ end
+ unless Rake::Task.task_defined?('jasmine')
+ File.open(dest_path('Rakefile'), write_mode) do |f|
+ f.write(File.read(template_path('lib/tasks/jasmine.rake')))
+ end
end
- write_mode = Rake::Task.task_defined?('jasmine') ? 'a' : 'w'
- File.open(dest_path('Rakefile'), write_mode) do |f|
- f.write(File.read(template_path('lib/tasks/jasmine.rake')))
- end
end
File.open(template_path('INSTALL'), 'r').each_line do |line|
puts line

0 comments on commit 0b02e82

Please sign in to comment.