Skip to content

Commit 127512f

Browse files
Merge pull request #4733 from NativeScript/fatme/fix-platform-commands
fix: fix `tns platform list` and `tns platform clean` commands
2 parents fc74281 + 1b21b95 commit 127512f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/helpers/platform-command-helper.ts

+4-2
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
}
@@ -103,7 +104,8 @@ export class PlatformCommandHelper implements IPlatformCommandHelper {
103104
}
104105

105106
const subDirs = this.$fs.readDirectory(projectData.platformsDir);
106-
return _.filter(subDirs, p => this.$mobileHelper.platformNames.indexOf(p) > -1);
107+
const platforms = this.$mobileHelper.platformNames.map(p => p.toLowerCase());
108+
return _.filter(subDirs, p => platforms.indexOf(p) > -1);
107109
}
108110

109111
public getAvailablePlatforms(projectData: IProjectData): string[] {

0 commit comments

Comments
 (0)