mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +08:00
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:
parent
434198c69b
commit
4f2bcdc7b7
@ -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.`);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user