Skip to content

Fix validation when specifying version to update #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/commands/update-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class UpdatePlatformCommand implements ICommand {
this.$errors.fail("No platform specified. Please specify platforms to update.");
}

_.each(args, arg => this.$platformService.validatePlatformInstalled(arg));
_.each(args, arg => this.$platformService.validatePlatformInstalled(arg.split("@")[0]));

return true;
}).future<boolean>()();
Expand Down
3 changes: 2 additions & 1 deletion lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ export class PlatformService implements IPlatformService {
this.$errors.fail("No platform specified.")
}

platform = platform.toLowerCase();
var parts = platform.split("@");
platform = parts[0].toLowerCase();

if (!this.isValidPlatform(platform)) {
this.$errors.fail("Invalid platform %s. Valid platforms are %s.", platform, helpers.formatListOfNames(this.$platformsData.platformsNames));
Expand Down