Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
error.errno = 1391852448;
return error;
}
// Keep the intermediate files
options = _.extend({}, defaultOptions, options || {});
options.verbose = Math.max(0, Math.min(3, parseInt(options.verbose, 10) || 0));
// Temporarily alter the configuration options to keep intermediate files and suppress all output rendering
options._keep = options.keep;
options.keep = 1;
options._render = _.extend({css: true}, options.render);
options.render = {css: false};
// Create the SVG sprite
var sprite = SVGSprite.createSprite(inputDir, outputDir, options, function(error, results) {
// Restore configuration options
results.options = restoreOptions(results.options);
// If an error occured while creating the SVG sprite: Abort
if (error) {
callback(error, results);
// Else: Create icon kit
} else {
new Iconizr(results).createIconKit(callback);
}
});
// In case of an error: Return it
if (util.isError(sprite)) {
this.files.forEach(function(file) {
var indir = file.src.shift() || './',
outdir = util.isArray(file.dest) ? file.dest.shift() : ('' + file.dest),
done = that.async();
console.log('Building SVG sprite from directory "%s" ...', indir);
SVGSprite.createSprite(indir, outdir, options, function(error, results) {
if (error) {
console.error(error);
} else {
for (var file in results.files) {
grunt.log.writeln(chalk.green('✔ ') + file + chalk.gray(' (' + results.files[file] + ' bytes)'));
}
}
done();
});
});
});