Skip to content

Commit 23a9fa2

Browse files
committed
fix: fix platform clean when there is a platform with specific version already added
To reproduce: 1. `tns platform add [email protected]` 2. `tns platform clean ios` Expected output: Platform ios successfully removed. Copying template files... Platform ios successfully added. v5.1.0 Actual output: Platform ios successfully removed. Copying template files... Platform ios successfully added. v5.4.2
1 parent e5f9d45 commit 23a9fa2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/helpers/platform-command-helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ export class PlatformCommandHelper implements IPlatformCommandHelper {
4343

4444
public async cleanPlatforms(platforms: string[], projectData: IProjectData, framworkPath: string): Promise<void> {
4545
for (const platform of platforms) {
46+
const version: string = this.getCurrentPlatformVersion(platform, projectData);
47+
4648
await this.removePlatforms([platform], projectData);
4749

48-
const version: string = this.getCurrentPlatformVersion(platform, projectData);
4950
const platformParam = version ? `${platform}@${version}` : platform;
5051
await this.addPlatforms([platformParam], projectData, framworkPath);
5152
}

0 commit comments

Comments
 (0)