Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const runGenerator = (args, options) => {
const generators = goomiGenerators.getGeneratorList();
if (!args.generatorName) {
plopOout.chooseOptionFromList(generators).then(function (generatorName) {
doThePlop(goomiGenerators.getGenerator(generatorName));
});
} else if (
generators
.map(function (v) {
return v.name;
})
.indexOf(args.generatorName) > -1
) {
doThePlop(goomiGenerators.getGenerator(args.generatorName));
} else {
console.error(chalk.red('[PLOP] ') + 'Generator "' + generator + '" not found in plopfile');
process.exit(1);
}
};