Skip to content

Commit

Permalink
Generate proper options to avoid gulp property pollution.
Browse files Browse the repository at this point in the history
  • Loading branch information
leny committed Jan 5, 2014
1 parent a22e1ea commit 290f1fc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ module.exports = function(opt){

var str = file.contents.toString('utf8');

var options = {};

if ( opt ) {
options = {
bare: opt.bare != null ? !!opt.bare : false,
literate: opt.literate != null ? !!opt.literate : false
}
}

try {
file.contents = new Buffer(coffee.compile(str, opt));
file.contents = new Buffer(coffee.compile(str, options));
} catch (err) {
var newError = formatError(file, err);
return this.emit('error', newError);
Expand Down

0 comments on commit 290f1fc

Please sign in to comment.