Skip to content

Commit

Permalink
fix: update should update runtime versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 committed Sep 4, 2020
1 parent 419ecda commit 5e15627
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions lib/controllers/update-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,14 @@ export class UpdateController
const templateRuntimeVersion =
templatePlatformData && templatePlatformData.version;
if (
templateRuntimeVersion &&
(await this.shouldUpdateRuntimeVersion(
templateRuntimeVersion,
await this.shouldUpdateRuntimeVersion(
// templateRuntimeVersion is only set if the template has the legacy nativescript key in package.json
// in other cases, we are just going to default to using the latest
templateRuntimeVersion || "*",
platformData.frameworkPackageName,
platform,
projectData
))
)
) {
return true;
}
Expand Down Expand Up @@ -441,17 +442,26 @@ export class UpdateController
const templateRuntimeVersion =
templatePlatformData && templatePlatformData.version;
if (
templateRuntimeVersion &&
(await this.shouldUpdateRuntimeVersion(
templateRuntimeVersion,
await this.shouldUpdateRuntimeVersion(
// templateRuntimeVersion is only set if the template has the legacy nativescript key in package.json
// in other cases, we are just going to default to using the latest
templateRuntimeVersion || "*",
platformData.frameworkPackageName,
platform,
projectData
))
)
) {
const version =
templateRuntimeVersion ||
(await this.$packageInstallationManager.getMaxSatisfyingVersionSafe(
platformData.frameworkPackageName,
"*"
));

this.$logger.info(
`Updating ${platform} platform to version '${templateRuntimeVersion}'.`
`Updating ${platform} platform to version '${version}'.`
);

await this.$addPlatformService.setPlatformVersion(
platformData,
projectData,
Expand Down

0 comments on commit 5e15627

Please sign in to comment.