fix(core): run workspace-generators within the same process
This commit is contained in:
parent
370831d527
commit
b4fe292d83
@ -24,6 +24,7 @@ import { output } from '../utilities/output';
|
|||||||
import type { CompilerOptions } from 'typescript';
|
import type { CompilerOptions } from 'typescript';
|
||||||
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
|
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
|
||||||
import { logger, normalizePath } from '@nrwl/devkit';
|
import { logger, normalizePath } from '@nrwl/devkit';
|
||||||
|
import { generate } from '@nrwl/tao/src/commands/generate';
|
||||||
|
|
||||||
const rootDirectory = appRootPath;
|
const rootDirectory = appRootPath;
|
||||||
|
|
||||||
@ -46,17 +47,14 @@ export async function workspaceGenerators(args: string[]) {
|
|||||||
}
|
}
|
||||||
const generatorName = args[0];
|
const generatorName = args[0];
|
||||||
const ws = new Workspaces(rootDirectory);
|
const ws = new Workspaces(rootDirectory);
|
||||||
|
args[0] = collectionFile + ':' + generatorName;
|
||||||
if (ws.isNxGenerator(collectionFile, generatorName)) {
|
if (ws.isNxGenerator(collectionFile, generatorName)) {
|
||||||
try {
|
process.exitCode = await generate(
|
||||||
execSync(
|
process.cwd(),
|
||||||
`npx tao g "${collectionFile}":${generatorName} ${args
|
rootDirectory,
|
||||||
.slice(1)
|
args,
|
||||||
.join(' ')}`,
|
parsedArgs.verbose
|
||||||
{ stdio: ['inherit', 'inherit', 'inherit'] }
|
);
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const logger = require('@angular-devkit/core/node').createConsoleLogger(
|
const logger = require('@angular-devkit/core/node').createConsoleLogger(
|
||||||
parsedArgs.verbose,
|
parsedArgs.verbose,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user