Skip to content

Commit da97bbc

Browse files
fix(migrations): passed in paths will be respected in nx workspaces (#52796)
This fixes a bug where if you have multiple tsconfig files, the migration would not find anything to migrate at the passed in path. fixes: #52787 PR Close #52796
1 parent 17adf0f commit da97bbc

File tree

1 file changed

+4
-3
lines changed
  • packages/core/schematics/ng-generate/control-flow-migration

1 file changed

+4
-3
lines changed

packages/core/schematics/ng-generate/control-flow-migration/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {Rule, SchematicContext, SchematicsException, Tree} from '@angular-devkit
1010
import {join, relative} from 'path';
1111

1212
import {normalizePath} from '../../utils/change_tracker';
13-
import {getProjectTsConfigPaths} from '../../utils/project_tsconfig_paths';
1413
import {canMigrateFile, createMigrationProgram} from '../../utils/typescript/compiler_host';
1514

1615
import {migrateTemplate} from './migration';
@@ -23,10 +22,12 @@ interface Options {
2322

2423
export default function(options: Options): Rule {
2524
return async (tree: Tree, context: SchematicContext) => {
26-
const {buildPaths, testPaths} = await getProjectTsConfigPaths(tree);
2725
const basePath = process.cwd();
2826
const pathToMigrate = normalizePath(join(basePath, options.path));
29-
const allPaths = options.path !== './' ? [...buildPaths, ...testPaths] : [pathToMigrate];
27+
let allPaths = [];
28+
if (pathToMigrate.trim() !== '') {
29+
allPaths.push(pathToMigrate);
30+
}
3031

3132
if (!allPaths.length) {
3233
throw new SchematicsException(

0 commit comments

Comments
 (0)