Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 3863

Show
Ignore:
Timestamp:
03/13/06 18:45:40 (3 years ago)
Author:
xal
Message:

Don't replace application.js in public/javascripts if it already exists [Cody Fauser]. Closes #4195

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/CHANGELOG

    r3857 r3863  
    11*SVN* 
     2 
     3* Don't replace application.js in public/javascripts if it already exists [Cody Fauser] 
    24 
    35* Change test:uncommitted to delay execution of `svn status` by using internal Rake API's. [Nicholas Seckar] 
  • trunk/railties/lib/tasks/framework.rake

    r3783 r3863  
    8686 
    8787    desc "Update your javascripts from your current rails install" 
    88     task :javascripts do  
     88    task :javascripts do 
    8989      require 'railties_path'   
    90       FileUtils.cp(Dir[RAILTIES_PATH + '/html/javascripts/*.js'], RAILS_ROOT + '/public/javascripts/') 
     90      project_dir = RAILS_ROOT + '/public/javascripts/' 
     91      scripts = Dir[RAILTIES_PATH + '/html/javascripts/*.js'] 
     92      scripts.reject!{|s| File.basename(s) == 'application.js'} if File.exists?(project_dir + 'application.js') 
     93      FileUtils.cp(scripts, project_dir) 
    9194    end 
    9295  end