From 096163e5832e30aa26cc991316b67633f8daf3de Mon Sep 17 00:00:00 2001 From: georgeerickson Date: Tue, 8 May 2012 18:22:15 -0400 Subject: [PATCH] better cake --- Cakefile | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/Cakefile b/Cakefile index 544c4b8..eed3091 100644 --- a/Cakefile +++ b/Cakefile @@ -82,29 +82,33 @@ task 'build:templates', 'compiles all of the templates source', () -> task 'watch', 'compiles all code on save', -> #watch coffee script - watch_r assets.coffee.src_dir, (err, watcher) -> - watcher.on 'change', (target) -> - console.log target.path - growl "Building #{target.path}" - invoke 'build:coffee' + if assets.coffee + watch_r assets.coffee.src_dir, (err, watcher) -> + watcher.on 'change', (target) -> + console.log target.path + growl "Building #{target.path}" + invoke 'build:coffee' - watch_r assets.less.src_dir, (err, watcher) -> - watcher.on 'change', (target) -> - console.log target.path - growl "Building #{target.path}" - invoke 'build:less' + if assets.less + watch_r assets.less.src_dir, (err, watcher) -> + watcher.on 'change', (target) -> + console.log target.path + growl "Building #{target.path}" + invoke 'build:less' - watch_r assets.jade.src_dir, (err, watcher) -> - watcher.on 'change', (target) -> - console.log target.path - growl "Building #{target.path}" - invoke 'build:jade' + if assets.jade + watch_r assets.jade.src_dir, (err, watcher) -> + watcher.on 'change', (target) -> + console.log target.path + growl "Building #{target.path}" + invoke 'build:jade' - watch_r assets.templates.src_dir, (err, watcher) -> - watcher.on 'change', (target) -> - console.log target.path - growl "Building #{target.path}" - invoke 'build:templates' + if assets.templates + watch_r assets.templates.src_dir, (err, watcher) -> + watcher.on 'change', (target) -> + console.log target.path + growl "Building #{target.path}" + invoke 'build:templates'