Handle HAML compile errors and output message to the console.
This commit is contained in:
parent
664328e95c
commit
8c7986109f
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue