Skip to content

Commit

Permalink
fix(@schematics/angular): prevent error when tsconfig file is missing…
Browse files Browse the repository at this point in the history
… in application builder migration

If the root tsconfig.json is missing we should not error.

Closes #29754
  • Loading branch information
alan-agius4 committed Mar 4, 2025
1 parent 434198c commit 4f2bcdc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,12 @@ function deleteFile(path: string): Rule {
}

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

Expand Down

0 comments on commit 4f2bcdc

Please sign in to comment.