зеркало из https://github.com/microsoft/just.git
adding a just-plop-helper load for the parent as well
This commit is contained in:
Родитель
d1888c03b3
Коммит
7b60548eae
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче