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
This commit is contained in:
Alan Agius 2025-03-04 15:36:18 +00:00
parent 434198c69b
commit 4f2bcdc7b7

View File

@ -460,8 +460,12 @@ function deleteFile(path: string): Rule {
}
function updateJsonFile(path: string, updater: (json: JSONFile) => void): Rule {
return (tree) => {
return (tree, ctx) => {
if (tree.exists(path)) {
updater(new JSONFile(tree, path));
} else {
ctx.logger.info(`Skipping updating '${path}' as it does not exist.`);
}
};
}