Skip to content

Commit e1aaf38

Browse files
committed
fix: platform clean not adding the platform back
fixes #5365
1 parent 6f91984 commit e1aaf38

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/controllers/platform-controller.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,13 @@ export class PlatformController implements IPlatformController {
114114
projectData.projectDir,
115115
platformData.platformNameLowerCase as SupportedPlatform
116116
);
117-
// if no version is explicitly added, then we use the latest
118-
if (!version && !desiredRuntimePackage.version) {
117+
118+
if (version) {
119+
desiredRuntimePackage.version = version;
120+
}
121+
122+
if (!desiredRuntimePackage.version) {
123+
// if no version is explicitly added, then we use the latest
119124
desiredRuntimePackage.version = await this.$packageInstallationManager.getLatestCompatibleVersion(
120125
desiredRuntimePackage.name
121126
);

lib/services/platform/platform-validation-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class PlatformValidationService implements IPlatformValidationService {
5454
);
5555
if (!hasPlatformDirectory) {
5656
this.$errors.fail(
57-
"The platform %s is not added to this project. Please use 'tns platform add <platform>'",
57+
"The platform %s is not added to this project. Please use 'ns platform add <platform>'",
5858
platform
5959
);
6060
}

0 commit comments

Comments
 (0)