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 ]
|
args: [ "--unix-newlines", "--no-escape-attrs", "--double-quote-attributes", src ]
|
||||||
|
|
||||||
grunt.util.spawn args, (err, result) ->
|
grunt.util.spawn args, (err, result) ->
|
||||||
|
if err
|
||||||
|
grunt.log.error 'Error compiling ' + src
|
||||||
|
return done err
|
||||||
[ext, result] = if options.templatize
|
[ext, result] = if options.templatize
|
||||||
[".js", "define(function() { return " + _.template(result.stdout).source + "});"]
|
[".js", "define(function() { return " + _.template(result.stdout).source + "});"]
|
||||||
else
|
else
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
};
|
};
|
||||||
return grunt.util.spawn(args, function(err, result) {
|
return grunt.util.spawn(args, function(err, result) {
|
||||||
var dest, ext, _ref;
|
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];
|
_ref = options.templatize ? [".js", "define(function() { return " + _.template(result.stdout).source + "});"] : ["html", result.stdout], ext = _ref[0], result = _ref[1];
|
||||||
dest = destPath;
|
dest = destPath;
|
||||||
destPath = (dest ? dest : path.dirname(src));
|
destPath = (dest ? dest : path.dirname(src));
|
||||||
|
|
Loading…
Reference in New Issue