Skip to content

Commit aac6be6

Browse files
committed
Validate platform in canExecute function
1 parent f95a53a commit aac6be6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/commands/prepare.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ export class PrepareCommand implements ICommand {
66
private $platformCommandParameter: ICommandParameter) { }
77

88
execute(args: string[]): IFuture<void> {
9-
return (() => {
10-
this.$platformService.preparePlatform(args[0]).wait();
11-
}).future<void>()();
9+
return this.$platformService.preparePlatform(args[0]);
1210
}
1311

1412
allowedParameters = [this.$platformCommandParameter];

lib/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class RunAndroidCommand extends RunCommandBase implements ICommand {
2828
private $platformsData: IPlatformsData) {
2929
super($platformService);
3030
}
31-
31+
3232
public allowedParameters: ICommandParameter[] = [];
3333

3434
public execute(args: string[]): IFuture<void> {

lib/services/platform-service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ export class PlatformService implements IPlatformService {
146146

147147
public preparePlatform(platform: string): IFuture<void> {
148148
return (() => {
149+
this.validatePlatform(platform);
150+
149151
platform = platform.toLowerCase();
150152

151153
var platformData = this.$platformsData.getPlatformData(platform);

0 commit comments

Comments
 (0)