Permalink
Browse files

Don't replace application.js in public/javascripts if it already exis…

…ts [Cody Fauser]. Closes #4195

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 25fb2db commit e9d6fea533e6b6fd1d9a6024de113370fdd13926 Tobias Lütke committed Mar 13, 2006
Showing with 8 additions and 3 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +6 −3 railties/lib/tasks/framework.rake
View
@@ -1,5 +1,7 @@
*SVN*
+* Don't replace application.js in public/javascripts if it already exists [Cody Fauser]
+
* Change test:uncommitted to delay execution of `svn status` by using internal Rake API's. [Nicholas Seckar]
* Use require_library_or_gem to load rake in commands/server.rb. Closes #4205. [rob.rasmussen@gmail.com]
@@ -85,9 +85,12 @@ namespace :rails do
end
desc "Update your javascripts from your current rails install"
- task :javascripts do
+ task :javascripts do
require 'railties_path'
- FileUtils.cp(Dir[RAILTIES_PATH + '/html/javascripts/*.js'], RAILS_ROOT + '/public/javascripts/')
+ project_dir = RAILS_ROOT + '/public/javascripts/'
+ scripts = Dir[RAILTIES_PATH + '/html/javascripts/*.js']
+ scripts.reject!{|s| File.basename(s) == 'application.js'} if File.exists?(project_dir + 'application.js')
+ FileUtils.cp(scripts, project_dir)
end
end
-end
+end

0 comments on commit e9d6fea

Please sign in to comment.