@@ -41,14 +41,14 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
41
41
// tslint:disable-next-line:no-big-function
42
42
async run ( options : UpdateCommandSchema & Arguments ) {
43
43
// Check if the current installed CLI version is older than the latest version.
44
- if ( await this . checkCLILatestVersion ( options . verbose ) ) {
44
+ if ( await this . checkCLILatestVersion ( options . verbose , options . next ) ) {
45
45
this . logger . warn (
46
46
'The installed Angular CLI version is older than the latest published version.\n' +
47
47
'Installing a temporary version to perform the update.' ,
48
48
) ;
49
49
50
50
return runTempPackageBin (
51
- ' @angular/cli@latest',
51
+ ` @angular/cli@${ options . next ? 'next' : ' latest'} ` ,
52
52
this . logger ,
53
53
this . packageManager ,
54
54
process . argv . slice ( 2 ) ,
@@ -403,7 +403,7 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
403
403
* Checks if the current installed CLI version is older than the latest version.
404
404
* @returns `true` when the installed version is older.
405
405
*/
406
- private async checkCLILatestVersion ( verbose = false ) : Promise < boolean > {
406
+ private async checkCLILatestVersion ( verbose = false , next = false ) : Promise < boolean > {
407
407
const { version : installedCLIVersion } = require ( '../package.json' ) ;
408
408
409
409
const LatestCLIManifest = await fetchPackageMetadata (
@@ -415,7 +415,7 @@ export class UpdateCommand extends SchematicCommand<UpdateCommandSchema> {
415
415
} ,
416
416
) ;
417
417
418
- const latest = LatestCLIManifest . tags [ 'latest' ] ;
418
+ const latest = LatestCLIManifest . tags [ next ? 'next' : 'latest' ] ;
419
419
if ( ! latest ) {
420
420
return false ;
421
421
}
0 commit comments