diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2006-03-13 18:45:40 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2006-03-13 18:45:40 +0000 |
commit | e9d6fea533e6b6fd1d9a6024de113370fdd13926 (patch) | |
tree | dfadb071f4609598c44b715c8acc7ccf3d7ea699 /railties/lib/tasks/framework.rake | |
parent | 25fb2db409f30437d901bf644b7cdea39ce64fdb (diff) | |
download | rails-e9d6fea533e6b6fd1d9a6024de113370fdd13926.tar.gz rails-e9d6fea533e6b6fd1d9a6024de113370fdd13926.tar.bz2 rails-e9d6fea533e6b6fd1d9a6024de113370fdd13926.zip |
Don't replace application.js in public/javascripts if it already exists [Cody Fauser]. Closes #4195
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/tasks/framework.rake')
-rw-r--r-- | railties/lib/tasks/framework.rake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake index 9e39e02edb..4ac7f7ebe0 100644 --- a/railties/lib/tasks/framework.rake +++ b/railties/lib/tasks/framework.rake @@ -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
\ No newline at end of file +end |