Skip to content

Commit dea6bb3

Browse files
clydinKeen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular/cli): only enable CLI 1.x update handling when no new config
Fixes #14703
1 parent 23553d1 commit dea6bb3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/angular/cli/commands/update-impl.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,18 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
104104
this.logger.info(`Using package manager: '${packageManager}'`);
105105

106106
// Special handling for Angular CLI 1.x migrations
107-
if (options.migrateOnly === undefined && options.from === undefined) {
108-
if (!options.all && packages.length === 1 && packages[0].name === '@angular/cli') {
109-
const oldConfigFilePath = findUp(oldConfigFileNames, process.cwd());
110-
if (oldConfigFilePath) {
107+
if (
108+
options.migrateOnly === undefined &&
109+
options.from === undefined &&
110+
!options.all &&
111+
packages.length === 1 &&
112+
packages[0].name === '@angular/cli' &&
113+
this.workspace.configFile &&
114+
oldConfigFileNames.includes(this.workspace.configFile)
115+
) {
111116
options.migrateOnly = true;
112117
options.from = '1.0.0';
113118
}
114-
}
115-
}
116119

117120
this.logger.info('Collecting installed dependencies...');
118121

0 commit comments

Comments
 (0)