Skip to content

Commit

Permalink
little optimization in the error adding script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Escalante committed Feb 27, 2013
1 parent 4d9e534 commit d02c83d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/utils/add_error_messages.js
Expand Up @@ -13,9 +13,8 @@ module.exports = function(error, cb){
global.options.error = true;
readdirp({ root: path.join(process.cwd(), 'public'), fileFilter: '*.html' }, function(err, res){
res.files.forEach(function(file){
var filepath = path.join(process.cwd(), 'public', file.path);
var wrapped_error = "<div id='roots-error'><span>compile error</span>" + error.toString().replace(/(\r\n|\n|\r)/gm, "<br>") + "</div>" + css;
fs.writeSync(fs.openSync(filepath, 'a+'), wrapped_error, null, 'utf-8');
fs.writeSync(fs.openSync(file.fullPath, 'a+'), wrapped_error, null, 'utf-8');
});
cb();
});
Expand Down

0 comments on commit d02c83d

Please sign in to comment.