Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-peaches

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-peaches - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

package.json
{
"name": "grunt-peaches",
"description": "The Grunt task for peaches.",
"version": "0.2.1",
"version": "0.2.2",
"author": {

@@ -6,0 +6,0 @@ "name": "afc163",

@@ -27,15 +27,15 @@ /*

"alipay": {
"name": "alipay",
"root": "./tmp",
"username": "liuqin.sheng",
"tmp": "./tmp",
"baseURI": "https://i.alipayobjects.com",
"uploadUrl": "https://ecmng.alipay.com/home/uploadFile.json"
"name":"alipay",
"root":"./tmp",
"username":"liuqin.sheng",
"tmp":"./tmp",
"baseURI":"https://i.alipayobjects.com",
"uploadUrl":"https://ecmng.alipay.com/home/uploadFile.json"
},
"tfsdaily": {
"name": "tfsdaily",
"root": "./images",
"tmp": "./tmp"
"tfsdaily": {
"name": "tfsdaily",
"root": "./images",
"tmp": "./tmp"
}
}
}
});

@@ -47,41 +47,46 @@

var destfile, src, srcContent;
var fname, destfile, src;
this.files.forEach(function(fileObj) {
fileObj.src.forEach(function(fpath) {
grunt.util.async.map(this.files,function(fileObj,callback){
if( fileObj.src.length > 1 ){
grunt.log.warn('This plugin don\'t support multi src file mapping to one dest file');
return;
}
var src = fileObj.src[0];
var destfile = fileObj.dest;
if (src.indexOf('-debug.css') > 0) {
if (fpath.indexOf('-debug.css') > 0) {
return;
}
// get the right filename and filepath
if (fileObj.cwd) {
// not expanded
fname = fpath;
fpath = path.join(fileObj.cwd, fpath);
} else {
fname = path.relative(fileObj.orig.cwd || '', fpath);
}
if (grunt.file.isDir(fpath)) {
grunt.file.mkdir(fpath);
return;
}
}
srcContent = grunt.file.read(src);
src = grunt.file.read(fpath);
destfile = path.join(fileObj.dest, fname);
require('peaches')(srcContent, options, function(err, styleText) {
if (err) {
grunt.log.writeln('Peaches error: ' + err + '.');
callback(err);
return;
}
require('peaches')(src, options, function(err, styleText) {
if (err) {
grunt.log.writeln('Peaches error: ' + err + '.');
return;
}
// Write the destination file.
grunt.file.write(destfile, styleText);
// Write the destination file.
grunt.file.write(destfile, styleText);
// Print a success message.
grunt.log.writeln('File "' + destfile + '" created.');
// Print a success message.
grunt.log.writeln('File "' + destfile + '" created.');
// Remove temp png files
grunt.file.glob.sync('sprite-*.png').forEach(function(f) {
grunt.file.delete(f);
});
// Remove temp png files
grunt.file.glob.sync('sprite-*.png').forEach(function(f) {
grunt.file.delete(f);
done();
});
callback(null,'done');
});
}, function(err,results) {
done(err,results);
});

@@ -88,0 +93,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc