adding a just-plop-helper load for the parent as well

This commit is contained in:
Ken 2019-08-05 22:10:00 -07:00
Родитель d1888c03b3
Коммит 7b60548eae
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -19,8 +19,12 @@ export async function getPlopGenerator(plopfilePath: string, destBasePath: strin
const parentPlopPath = (await downloadPackage(generator.parent))!; const parentPlopPath = (await downloadPackage(generator.parent))!;
const parentPlopFilePath = path.join(parentPlopPath, 'plopfile.js'); const parentPlopFilePath = path.join(parentPlopPath, 'plopfile.js');
const parentPlop = nodePlop(parentPlopFilePath, { destBasePath, force: false }); const parentPlop = nodePlop(parentPlopFilePath, { destBasePath, force: false });
(parentPlop as any).load(justPlopHelpers);
const parentGenerator = parentPlop.getGenerator(`repo:${generator.parent}`) as any; const parentGenerator = parentPlop.getGenerator(`repo:${generator.parent}`) as any;
const results = await parentGenerator.runActions(answers); const results = await parentGenerator.runActions(answers);
if (results.changes) { if (results.changes) {
return results.changes.map(change => change.path).join('\n'); return results.changes.map(change => change.path).join('\n');
} }