1
1
export class RunCommandBase {
2
- constructor ( private $platformService : IPlatformService ,
3
- private $usbLiveSyncService : ILiveSyncService ,
2
+ constructor ( protected $platformService : IPlatformService ,
3
+ protected $usbLiveSyncService : ILiveSyncService ,
4
4
protected $options : IOptions ) { }
5
5
6
6
public executeCore ( args : string [ ] ) : IFuture < void > {
@@ -16,7 +16,8 @@ export class RunIosCommand extends RunCommandBase implements ICommand {
16
16
constructor ( $platformService : IPlatformService ,
17
17
private $platformsData : IPlatformsData ,
18
18
$usbLiveSyncService : ILiveSyncService ,
19
- $options : IOptions ) {
19
+ $options : IOptions ,
20
+ private $injector : IInjector ) {
20
21
super ( $platformService , $usbLiveSyncService , $options ) ;
21
22
}
22
23
@@ -25,6 +26,10 @@ export class RunIosCommand extends RunCommandBase implements ICommand {
25
26
public execute ( args : string [ ] ) : IFuture < void > {
26
27
return this . executeCore ( [ this . $platformsData . availablePlatforms . iOS ] ) ;
27
28
}
29
+
30
+ public canExecute ( args : string [ ] ) : IFuture < boolean > {
31
+ return this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . iOS ) ;
32
+ }
28
33
}
29
34
$injector . registerCommand ( "run|ios" , RunIosCommand ) ;
30
35
@@ -48,7 +53,7 @@ export class RunAndroidCommand extends RunCommandBase implements ICommand {
48
53
if ( this . $options . release && ( ! this . $options . keyStorePath || ! this . $options . keyStorePassword || ! this . $options . keyStoreAlias || ! this . $options . keyStoreAliasPassword ) ) {
49
54
this . $errors . fail ( "When producing a release build, you need to specify all --key-store-* options." ) ;
50
55
}
51
- return args . length === 0 ;
56
+ return args . length === 0 && this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . Android ) . wait ( ) ;
52
57
} ) . future < boolean > ( ) ( ) ;
53
58
}
54
59
}
0 commit comments