Skip to content

Commit b1a71a5

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

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

lib/commands/debug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ export class DebugPlatformCommand implements ICommand {
77
execute(args: string[]): IFuture<void> {
88
return this.debugService.debug();
99
}
10-
10+
1111
allowedParameters: ICommandParameter[] = [];
1212
}
1313

1414
export class DebugIOSCommand extends DebugPlatformCommand {
1515
constructor(private $iOSDebugService: IDebugService) {
1616
super($iOSDebugService);
17-
}
17+
}
1818
}
1919
$injector.registerCommand("debug|ios", DebugIOSCommand);
2020

lib/commands/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class DeployOnDeviceCommand implements ICommand {
88
execute(args: string[]): IFuture<void> {
99
return this.$platformService.deployOnDevice(args[0]);
1010
}
11-
11+
1212
allowedParameters = [this.$platformCommandParameter];
1313
}
1414
$injector.registerCommand("deploy", DeployOnDeviceCommand);

lib/commands/prepare.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ 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
}
13-
11+
1412
allowedParameters = [this.$platformCommandParameter];
1513
}
1614
$injector.registerCommand("prepare", PrepareCommand);

lib/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class RunCommandBase {
66

77
public executeCore(args: string[]): IFuture<void> {
88
return this.$platformService.runPlatform(args[0]);
9-
}
9+
}
1010
}
1111

1212
export class RunIosCommand extends RunCommandBase implements ICommand {

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)