Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const filepath = f.src.toString();
if (typeof filepath !== 'string' || filepath === '') {
grunt.log.error('src must be a single string');
increaseCount();
return false;
}
if (!grunt.file.exists(filepath)) {
grunt.log.error(`Source file "${filepath}" not found.`);
increaseCount();
return false;
}
grunt.log.writeln("filepath:", filepath);
juice.juiceFile(filepath, options, function(err, html) {
if (err) {
grunt.log.error(err);
increaseCount();
return;
}
grunt.file.write(f.dest, html);
grunt.log.writeln(`File "${f.dest}" created.`);
increaseCount();
});
});
});
jobs.push(function(callback) {
juice.juiceFile(filepath, options, function(err, html) {
if (err) {
callback(err);
grunt.warn(err, 3);
}
else {
grunt.file.write(f.dest, html);
grunt.log.writeln('File "' + f.dest + '" created.');
callback();
}
});
});
});