From aac6be6cb1b77c6932131eeb75bb8a7faad5d20b Mon Sep 17 00:00:00 2001 From: Fatme Havaluova Date: Wed, 1 Jul 2015 10:05:15 +0300 Subject: [PATCH] Validate platform in canExecute function --- lib/commands/prepare.ts | 4 +--- lib/commands/run.ts | 2 +- lib/services/platform-service.ts | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commands/prepare.ts b/lib/commands/prepare.ts index e96d511895..7f07f4644e 100644 --- a/lib/commands/prepare.ts +++ b/lib/commands/prepare.ts @@ -6,9 +6,7 @@ export class PrepareCommand implements ICommand { private $platformCommandParameter: ICommandParameter) { } execute(args: string[]): IFuture { - return (() => { - this.$platformService.preparePlatform(args[0]).wait(); - }).future()(); + return this.$platformService.preparePlatform(args[0]); } allowedParameters = [this.$platformCommandParameter]; diff --git a/lib/commands/run.ts b/lib/commands/run.ts index 6b81087957..7bbbb1e596 100644 --- a/lib/commands/run.ts +++ b/lib/commands/run.ts @@ -28,7 +28,7 @@ export class RunAndroidCommand extends RunCommandBase implements ICommand { private $platformsData: IPlatformsData) { super($platformService); } - + public allowedParameters: ICommandParameter[] = []; public execute(args: string[]): IFuture { diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index e47f318a92..cd56ec2a34 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -146,6 +146,8 @@ export class PlatformService implements IPlatformService { public preparePlatform(platform: string): IFuture { return (() => { + this.validatePlatform(platform); + platform = platform.toLowerCase(); var platformData = this.$platformsData.getPlatformData(platform);