grunt-compass
Advanced tools
Comparing version 0.2.4 to 0.2.5
{ | ||
"name": "grunt-compass", | ||
"description": "A custom grunt.js task that executes compass compile for you and prints the COMPASS output to grunt.log.write().", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"homepage": "https://github.com/kahlil/grunt-compass", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -46,4 +46,2 @@ # `compass compile` for grunt.js | ||
``` | ||
6. Run "grunt watch" and change some SASS files :) | ||
_**Notice:** At this moment this task doesn't work with `grunt` or `grunt compass` only with `grunt watch`. Calling `grunt compass` only creates the folders, not the files!_ | ||
6. Run "grunt watch" and change some SASS files :) |
module.exports = function( grunt ) { | ||
// Create a new task. | ||
grunt.registerTask( 'compass', 'This triggers the `compass compile` command.', function() { | ||
// Create a new multi task. | ||
grunt.registerMultiTask( 'compass', 'This triggers the `compass compile` command.', function() { | ||
var exec = require('child_process').exec, | ||
// Tell grunt this task is asynchronous. | ||
var done = this.async(), | ||
exec = require('child_process').exec, | ||
command = "compass compile", | ||
src = grunt.config('compass.src'), | ||
dest = grunt.config('compass.dest'), | ||
outputstyle = grunt.config('compass.outputstyle'), | ||
linecomments = grunt.config('comments.linecomments'); | ||
src = this.data.src, | ||
dest = this.data.dest, | ||
outputstyle = this.data.outputstyle, | ||
linecomments = this.data.linecomments; | ||
@@ -29,7 +31,14 @@ if ( src !== undefined && dest !== undefined ) { | ||
grunt.log.write( stdout ); | ||
grunt.log.error( stderr ); | ||
/* grunt.log.error( stderr ); | ||
* compass sends falsy error message to stderr... real sass/compass errors come in through the "error" variable. | ||
*/ | ||
if ( error !== null ) { | ||
grunt.log.error( error ); | ||
done(false); | ||
} | ||
else | ||
{ | ||
done(true); | ||
} | ||
} | ||
@@ -36,0 +45,0 @@ |
4688
38
46