File tree 1 file changed +13
-4
lines changed
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ export class DeployOnDeviceCommand implements ICommand {
5
5
constructor ( private $platformService : IPlatformService ,
6
6
private $platformCommandParameter : ICommandParameter ,
7
7
private $options : IOptions ,
8
- private $errors : IErrors ) { }
8
+ private $errors : IErrors ,
9
+ private $mobileHelper : Mobile . IMobileHelper ) { }
9
10
10
11
execute ( args : string [ ] ) : IFuture < void > {
11
12
let config = this . $options . staticBindings ? { runSbGenerator : true } : undefined ;
@@ -14,11 +15,19 @@ export class DeployOnDeviceCommand implements ICommand {
14
15
15
16
public canExecute ( args : string [ ] ) : IFuture < boolean > {
16
17
return ( ( ) => {
17
- if ( this . $options . release && ( ! this . $options . keyStorePath || ! this . $options . keyStorePassword || ! this . $options . keyStoreAlias || ! this . $options . keyStoreAliasPassword ) ) {
18
+ if ( ! args || ! args . length || args . length > 1 ) {
19
+ return false ;
20
+ }
21
+
22
+ if ( ! this . $platformCommandParameter . validate ( args [ 0 ] ) . wait ( ) ) {
23
+ return false ;
24
+ }
25
+
26
+ if ( this . $mobileHelper . isAndroidPlatform ( args [ 0 ] ) && this . $options . release && ( ! this . $options . keyStorePath || ! this . $options . keyStorePassword || ! this . $options . keyStoreAlias || ! this . $options . keyStoreAliasPassword ) ) {
18
27
this . $errors . fail ( "When producing a release build, you need to specify all --key-store-* options." ) ;
19
28
}
20
- let res = ( args . length === 1 ) && this . $platformCommandParameter . validate ( args [ 0 ] ) . wait ( ) ;
21
- return res ;
29
+
30
+ return true ;
22
31
} ) . future < boolean > ( ) ( ) ;
23
32
}
24
33
You can’t perform that action at this time.
0 commit comments