Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.stat(file, function(err, stat) {
if (!err) {
return execCallback();
}
logger.warn(err);
fse.ensureFile(file, function(err) {
execCallback(err ? null : fs.createWriteStream(file).on('error', logger.error));
logger.error(err);
});
});
}