diff --git a/src/ruby-haml.coffee b/src/ruby-haml.coffee index 1a40b65..1d8f9a5 100644 --- a/src/ruby-haml.coffee +++ b/src/ruby-haml.coffee @@ -15,6 +15,9 @@ module.exports = (grunt) -> args: [ "--unix-newlines", "--no-escape-attrs", "--double-quote-attributes", src ] grunt.util.spawn args, (err, result) -> + if err + grunt.log.error 'Error compiling ' + src + return done err [ext, result] = if options.templatize [".js", "define(function() { return " + _.template(result.stdout).source + "});"] else diff --git a/tasks/ruby-haml.js b/tasks/ruby-haml.js index a744655..0be5c94 100644 --- a/tasks/ruby-haml.js +++ b/tasks/ruby-haml.js @@ -13,6 +13,10 @@ }; return grunt.util.spawn(args, function(err, result) { var dest, ext, _ref; + if (err) { + grunt.log.error('Error compiling ' + src); + return done(err); + } _ref = options.templatize ? [".js", "define(function() { return " + _.template(result.stdout).source + "});"] : ["html", result.stdout], ext = _ref[0], result = _ref[1]; dest = destPath; destPath = (dest ? dest : path.dirname(src));