File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 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 {
55 constructor ( private $platformService : IPlatformService ,
66 private $platformCommandParameter : ICommandParameter ,
77 private $options : IOptions ,
8- private $errors : IErrors ) { }
8+ private $errors : IErrors ,
9+ private $mobileHelper : Mobile . IMobileHelper ) { }
910
1011 execute ( args : string [ ] ) : IFuture < void > {
1112 let config = this . $options . staticBindings ? { runSbGenerator : true } : undefined ;
@@ -14,11 +15,19 @@ export class DeployOnDeviceCommand implements ICommand {
1415
1516 public canExecute ( args : string [ ] ) : IFuture < boolean > {
1617 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 ) ) {
1827 this . $errors . fail ( "When producing a release build, you need to specify all --key-store-* options." ) ;
1928 }
20- let res = ( args . length === 1 ) && this . $platformCommandParameter . validate ( args [ 0 ] ) . wait ( ) ;
21- return res ;
29+
30+ return true ;
2231 } ) . future < boolean > ( ) ( ) ;
2332 }
2433
You can’t perform that action at this time.
0 commit comments