Skip to content

Commit

Permalink
fix(@angular/cli): only enable CLI 1.x update handling when no new co…
Browse files Browse the repository at this point in the history
…nfig

Fixes #14703
  • Loading branch information
clydin authored and Keen Yee Liau committed Jun 11, 2019
1 parent 23553d1 commit dea6bb3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/angular/cli/commands/update-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,18 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
this.logger.info(`Using package manager: '${packageManager}'`);

// Special handling for Angular CLI 1.x migrations
if (options.migrateOnly === undefined && options.from === undefined) {
if (!options.all && packages.length === 1 && packages[0].name === '@angular/cli') {
const oldConfigFilePath = findUp(oldConfigFileNames, process.cwd());
if (oldConfigFilePath) {
if (
options.migrateOnly === undefined &&
options.from === undefined &&
!options.all &&
packages.length === 1 &&
packages[0].name === '@angular/cli' &&
this.workspace.configFile &&
oldConfigFileNames.includes(this.workspace.configFile)
) {
options.migrateOnly = true;
options.from = '1.0.0';
}
}
}

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

Expand Down

0 comments on commit dea6bb3

Please sign in to comment.