From 6b68f2c0fe29c510d093d86af00e029242e7eb83 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Tue, 4 Jun 2013 12:22:28 -0400 Subject: [PATCH] Use coffee watch command to watch whole directories, so that it will pick up new coffee files as they are created --- rakefiles/assets.rake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rakefiles/assets.rake b/rakefiles/assets.rake index 45a7de1102..a3564c2650 100644 --- a/rakefiles/assets.rake +++ b/rakefiles/assets.rake @@ -27,10 +27,11 @@ def coffee_cmd(watch=false, debug=false) # # Ref: https://github.com/joyent/node/issues/2479 # - # Instead, watch 50 files per process in parallel + # Rather than watching all of the directories in one command + # watch each static files subdirectory separately cmds = [] - Dir['*/static/**/*.coffee'].each_slice(50) do |coffee_files| - cmds << "node_modules/.bin/coffee --watch --compile #{coffee_files.join(' ')}" + ['lms/static/coffee', 'cms/static/coffee', 'common/static/coffee', 'common/static/xmodule'].each do |coffee_folder| + cmds << "node_modules/.bin/coffee --watch --compile #{coffee_folder}" end cmds else @@ -119,12 +120,15 @@ namespace :assets do namespace :sass do # In watch mode, sass doesn't immediately compile out of date files, # so force a recompile first - task :_watch => 'assets:sass:debug' + # Also force xmodule files to be generated before we start watching anything + task :_watch => ['assets:sass:debug', 'assets:xmodule'] multitask :debug => 'assets:xmodule:debug' end multitask :coffee => 'assets:xmodule' namespace :coffee do + # Force xmodule files to be generated before we start watching anything + task :_watch => 'assets:xmodule' multitask :debug => 'assets:xmodule:debug' end end