Skip to content

Commit 4f2bcdc

Browse files
committed
fix(@schematics/angular): prevent error when tsconfig file is missing in application builder migration
If the root tsconfig.json is missing we should not error. Closes #29754
1 parent 434198c commit 4f2bcdc

File tree

1 file changed

+6
-2
lines changed
  • packages/schematics/angular/migrations/use-application-builder

1 file changed

+6
-2
lines changed

packages/schematics/angular/migrations/use-application-builder/migration.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,12 @@ function deleteFile(path: string): Rule {
460460
}
461461

462462
function updateJsonFile(path: string, updater: (json: JSONFile) => void): Rule {
463-
return (tree) => {
464-
updater(new JSONFile(tree, path));
463+
return (tree, ctx) => {
464+
if (tree.exists(path)) {
465+
updater(new JSONFile(tree, path));
466+
} else {
467+
ctx.logger.info(`Skipping updating '${path}' as it does not exist.`);
468+
}
465469
};
466470
}
467471

0 commit comments

Comments
 (0)