diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/tasks/assets.rake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/rails/tasks/assets.rake b/railties/lib/rails/tasks/assets.rake index 5d2f02af13..1168409dcb 100644 --- a/railties/lib/rails/tasks/assets.rake +++ b/railties/lib/rails/tasks/assets.rake @@ -1,3 +1,5 @@ +require "fileutils" + namespace :assets do desc "Compile all the assets named in config.assets.precompile" task :precompile => :environment do @@ -7,4 +9,12 @@ namespace :assets do assets = Rails.application.config.assets.precompile Rails.application.assets.precompile(*assets) end + + desc "Remove compiled assets" + task :cleanup => :environment do + assets = Rails.application.config.assets + public_asset_path = Rails.public_path + assets.prefix + FileUtils.rm_r Dir.glob("#{public_asset_path}/*.js") + FileUtils.rm_r Dir.glob("#{public_asset_path}/*.css") + end end |