Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function runGenerator(generator: any, args: any) {
const results = await generator.runActions(args, {
onComment: (comment: string) => {
logger.info(comment);
}
});
if (results.failures && results.failures.length > 0) {
throw new Error('Error: ' + results.failures[0].error);
}
// do something after the actions have run
for (let change of results.changes) {
if (change.path) {
logger.info(change.path);
}
}
}
handler(_argvParam: any) {
if (isCached(taskName)) {
logger.info(`Skipped ${taskName} since it was cached`);
return;
}
return undertaker.parallel(taskName)(() => {
saveCache(taskName);
});
}
};
onComment: (comment: string) => {
logger.info(comment);
}
});