@@ -167,13 +167,14 @@ export class UpdateController
167
167
const templateRuntimeVersion =
168
168
templatePlatformData && templatePlatformData . version ;
169
169
if (
170
- templateRuntimeVersion &&
171
- ( await this . shouldUpdateRuntimeVersion (
172
- templateRuntimeVersion ,
170
+ await this . shouldUpdateRuntimeVersion (
171
+ // templateRuntimeVersion is only set if the template has the legacy nativescript key in package.json
172
+ // in other cases, we are just going to default to using the latest
173
+ templateRuntimeVersion || "*" ,
173
174
platformData . frameworkPackageName ,
174
175
platform ,
175
176
projectData
176
- ) )
177
+ )
177
178
) {
178
179
return true ;
179
180
}
@@ -441,17 +442,26 @@ export class UpdateController
441
442
const templateRuntimeVersion =
442
443
templatePlatformData && templatePlatformData . version ;
443
444
if (
444
- templateRuntimeVersion &&
445
- ( await this . shouldUpdateRuntimeVersion (
446
- templateRuntimeVersion ,
445
+ await this . shouldUpdateRuntimeVersion (
446
+ // templateRuntimeVersion is only set if the template has the legacy nativescript key in package.json
447
+ // in other cases, we are just going to default to using the latest
448
+ templateRuntimeVersion || "*" ,
447
449
platformData . frameworkPackageName ,
448
450
platform ,
449
451
projectData
450
- ) )
452
+ )
451
453
) {
454
+ const version =
455
+ templateRuntimeVersion ||
456
+ ( await this . $packageInstallationManager . getMaxSatisfyingVersionSafe (
457
+ platformData . frameworkPackageName ,
458
+ "*"
459
+ ) ) ;
460
+
452
461
this . $logger . info (
453
- `Updating ${ platform } platform to version '${ templateRuntimeVersion } '.`
462
+ `Updating ${ platform } platform to version '${ version } '.`
454
463
) ;
464
+
455
465
await this . $addPlatformService . setPlatformVersion (
456
466
platformData ,
457
467
projectData ,
0 commit comments