Skip to content

Commit

Permalink
Updating the node 8 fs fileWrite usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoramite committed Jul 24, 2017
1 parent 2e10150 commit 7471d55
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var initCacheFile = function(cacheFile, log) {
} else {
cacheFileSaved = true;
try {
fs.writeFileSync(cacheFile, JSON.stringify(lessFiles), 'utf8');
fs.writeFileSync(cacheFile, JSON.stringify(lessFiles));
log('successfully cached imports to file', cacheFile);
} catch (err) {
log('error caching imports to file ' + cacheFile, err);
Expand Down Expand Up @@ -119,7 +119,7 @@ module.exports = less.middleware = function(source, options){
mkdirp(path.dirname(pathname), 511 /* 0777 */, function(err){
if (err) return next(err);

fs.writeFile(pathname, css, 'utf8', next);
fs.writeFile(pathname, css, next);
});
},
storeSourcemap: function(pathname, sourcemap, req) {
Expand All @@ -129,7 +129,9 @@ module.exports = less.middleware = function(source, options){
return;
}

fs.writeFile(pathname, sourcemap, 'utf8');
fs.writeFile(pathname, sourcemap, function(err) {
if (err) throw err;
});
});
}
}, options || {});
Expand Down

0 comments on commit 7471d55

Please sign in to comment.