Skip to content

Commit

Permalink
Merge pull request #6 from eduardolundgren/master
Browse files Browse the repository at this point in the history
Emit plugin error on failure
  • Loading branch information
koistya committed Jul 14, 2014
2 parents 5f8826f + 8e3584e commit e63fdbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ function Plugin(config, log) {

var comb = new Comb(config || 'csscomb');
var syntax = file.path.split('.').pop();
var output = comb.processString(file.contents.toString('utf8'), syntax);
file.contents = new Buffer(output);

try {
var output = comb.processString(file.contents.toString('utf8'), syntax, file.path);
file.contents = new Buffer(output);
} catch (err) {
this.emit('error', new PluginError(PLUGIN_NAME, err));
}
}

// make sure the file goes through the next gulp plugin
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gulp-csscomb",
"description": "CSScomb is a coding style formatter for CSS.",
"version": "3.0.0-1",
"version": "3.0.0-2",
"homepage": "http://github.com/koistya/gulp-csscomb",
"repository": {
"type": "git",
Expand Down

0 comments on commit e63fdbc

Please sign in to comment.