grunt-contrib-sass
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "grunt-contrib-sass", | ||
"description": "Compile Sass to CSS", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-sass", | ||
@@ -28,3 +28,3 @@ "author": { | ||
"scripts": { | ||
"test": "grunt test" | ||
"test": "./node_modules/.bin/grunt test" | ||
}, | ||
@@ -35,3 +35,4 @@ "dependencies": { | ||
"devDependencies": { | ||
"grunt": "~0.4.0a", | ||
"grunt": "~0.4.0", | ||
"grunt-cli": "~0.1.1", | ||
"grunt-contrib-internal": "~0.1.0", | ||
@@ -38,0 +39,0 @@ "grunt-contrib-clean": "~0.4.0a", |
@@ -13,3 +13,2 @@ /* | ||
var path = require('path'); | ||
var async = grunt.util.async; | ||
@@ -20,48 +19,42 @@ grunt.registerMultiTask('sass', 'Compile Sass to CSS', function() { | ||
var cb = this.async(); | ||
var args = ['--stdin'].concat(helpers.optsToArgs(options)); | ||
var src = this.file.src; | ||
var dest = this.file.dest; | ||
var args = [dest, '--stdin'].concat(helpers.optsToArgs(options)); | ||
var max = src.map(function(filepath) { | ||
return grunt.file.read(filepath); | ||
}).join('\n'); | ||
grunt.verbose.writeflags(options, 'Options'); | ||
async.forEachSeries(this.files, function(el, cb2) { | ||
var elArgs = [el.dest]; | ||
var src = el.src; | ||
var files = grunt.file.expandFiles(src); | ||
var max = files.map(function(filepath) { | ||
return grunt.file.read(filepath); | ||
}).join('\n'); | ||
if (path.extname(src[0]) === '.scss') { | ||
args.push('--scss'); | ||
} | ||
if (path.extname(src) === '.scss') { | ||
elArgs.push('--scss'); | ||
} | ||
// Make sure grunt creates the destination folders | ||
grunt.file.write(dest, ''); | ||
// Make sure grunt creates the destination folders | ||
grunt.file.write(el.dest, ''); | ||
// Add dirs of specified files to the sass path | ||
src.forEach(function(el) { | ||
args.push('--load-path', path.dirname(el)); | ||
}); | ||
// Add dirs of specified files to the sass path | ||
files.forEach(function(el) { | ||
elArgs.push('--load-path', path.dirname(el)); | ||
}); | ||
var sass = grunt.util.spawn({ | ||
cmd: process.platform === 'win32' ? 'sass.bat' : 'sass', | ||
args: args | ||
}, function(error, result, code) { | ||
if (code === 127) { | ||
return grunt.warn( | ||
'You need to have Ruby and Sass installed and in your PATH for ' + | ||
'this task to work. More info: ' + | ||
'https://github.com/gruntjs/grunt-contrib-sass' | ||
); | ||
} | ||
cb(error); | ||
}); | ||
var sass = grunt.util.spawn({ | ||
cmd: process.platform === 'win32' ? 'sass.bat' : 'sass', | ||
args: elArgs.concat(args) | ||
}, function(error, result, code) { | ||
if (code === 127) { | ||
return grunt.warn( | ||
'You need to have Ruby and Sass installed and in your PATH for ' + | ||
'this task to work. More info: ' + | ||
'https://github.com/gruntjs/grunt-contrib-sass' | ||
); | ||
} | ||
cb2(code > 0); | ||
}); | ||
sass.stdin.write(new Buffer(max)); | ||
sass.stdin.end(); | ||
sass.stdout.pipe(process.stdout); | ||
sass.stderr.pipe(process.stderr); | ||
}, function(error) { | ||
cb(!error); | ||
}); | ||
sass.stdin.write(new Buffer(max)); | ||
sass.stdin.end(); | ||
sass.stdout.pipe(process.stdout); | ||
sass.stderr.pipe(process.stderr); | ||
}); | ||
}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
9164
6
113