Skip to content

Commit 380ac42

Browse files
committed
fix(@angular/cli): skip downloading temp CLI when running ng update without package names
In the case when `ng update` is ran without a package name, an update is not be performed. In this case using the current installed version of the CLI is good enough. Closes angular#24024
1 parent 8c915d4 commit 380ac42

File tree

1 file changed

+3
-2
lines changed
  • packages/angular/cli/src/commands/update

1 file changed

+3
-2
lines changed

packages/angular/cli/src/commands/update/cli.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ export class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
165165
packageManager.ensureCompatibility();
166166

167167
// Check if the current installed CLI version is older than the latest compatible version.
168-
if (!disableVersionCheck) {
168+
// Skip when running `ng update` without a package name as this will not trigger an actual update.
169+
if (!disableVersionCheck && options.packages?.length) {
169170
const cliVersionToInstall = await this.checkCLIVersion(
170171
options.packages,
171172
options.verbose,
@@ -882,7 +883,7 @@ export class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
882883
* @returns the version to install or null when there is no update to install.
883884
*/
884885
private async checkCLIVersion(
885-
packagesToUpdate: string[] | undefined,
886+
packagesToUpdate: string[],
886887
verbose = false,
887888
next = false,
888889
): Promise<string | null> {

0 commit comments

Comments
 (0)