more thenify in node/utils/*

This commit is contained in:
Ray Bellis 2019-01-22 17:30:33 +00:00
parent 584e481430
commit 5ef4a2d1d5
5 changed files with 26 additions and 21 deletions

View file

@ -5,8 +5,9 @@
var log4js = require('log4js');
var settings = require('./Settings');
var spawn = require('child_process').spawn;
const thenify = require("thenify").withCallback;
exports.tidy = function(srcFile, callback) {
exports.tidy = thenify(function(srcFile, callback) {
var logger = log4js.getLogger('TidyHtml');
// Don't do anything if Tidy hasn't been enabled
@ -38,4 +39,4 @@ exports.tidy = function(srcFile, callback) {
return callback('Tidy died with exit code ' + code);
}
});
};
});