Skip to content

Commit

Permalink
if the response tell <No savings> after smush.it service, continue up…
Browse files Browse the repository at this point in the history
…loading image to CDN
  • Loading branch information
colorhook committed Jun 25, 2012
1 parent 396a743 commit 1bf7d00
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,14 @@ var minifyFile = function(file, datauri, callback){
options.toAbsolutePath = true;
options.workspaceRoot = workspaceRoot;
}
MinifyCommand.execute(options, function (err) {
MinifyCommand.execute(options, function (err, response) {
if (err) {
if(response && response.error){
if(response.error.match(/No savings/i)){
console.log('Image no saving: ' + file);
return callback(null, toName);
}
}
console.log("Error occur at: " + file);
console.log(err);
} else {
Expand Down

0 comments on commit 1bf7d00

Please sign in to comment.