File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,30 @@ inquirer
24
24
type : 'list' ,
25
25
message : 'Choose a platform to run on' ,
26
26
name : 'platform' ,
27
- choices : [ 'Android' , 'iOS' ]
27
+ choices : [ 'Android' , 'iOS' , 'Both' ]
28
28
}
29
29
] )
30
30
. then ( res => {
31
31
setMain ( res . sample )
32
- tns = spawn ( 'tns' , [ 'run' , res . platform ] , {
33
- cwd : path . resolve ( __dirname , '../samples ')
34
- } )
32
+ if ( res . platform . toLowerCase ( ) === 'both' ) {
33
+ runPlatform ( 'ios ')
34
+ runPlatform ( 'android' )
35
35
36
- tns . on ( 'error' , err => console . log ( err ) )
37
- tns . stdout . on ( 'data' , data => process . stdout . write ( data ) )
36
+ return ;
37
+ }
38
+
39
+ runPlatform ( res . platform )
40
+ } )
41
+
42
+ function runPlatform ( platform ) {
43
+ tns = spawn ( 'tns' , [ 'run' , platform ] , {
44
+ cwd : path . resolve ( __dirname , '../samples' )
38
45
} )
39
46
47
+ tns . on ( 'error' , err => console . log ( err ) )
48
+ tns . stdout . on ( 'data' , data => process . stdout . write ( platform + ': ' + data ) )
49
+ }
50
+
40
51
function shutDown ( ) {
41
52
if ( tns ) {
42
53
tns . stdin . pause ( )
You can’t perform that action at this time.
0 commit comments