File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change
1
+ import * as Debug from 'debug' ;
1
2
import { DeviceValues } from 'node-ioslib' ;
2
3
3
4
import { Target , list } from '../utils/list' ;
4
5
5
6
import { getConnectedDevices } from './utils/device' ;
6
7
import { Simulator , getSimulators } from './utils/simulator' ;
7
8
9
+ const debug = Debug ( 'native-run:ios:list' ) ;
10
+
8
11
export async function run ( args : string [ ] ) {
9
- // TODO check for darwin?
10
- const [ devices , simulators ] = await Promise . all ( [
11
- ( await getConnectedDevices ( ) ) . map ( deviceToTarget ) ,
12
- ( await getSimulators ( ) ) . map ( simulatorToTarget ) ,
13
- ] ) ;
12
+ const devicesPromise = getConnectedDevices ( )
13
+ . then ( devices => devices . map ( deviceToTarget ) )
14
+ . catch ( err => {
15
+ debug ( `There was an error getting the iOS device list: ${ err . message } ` ) ;
16
+ return [ ] ;
17
+ } ) ;
18
+
19
+ const simulatorsPromise = getSimulators ( )
20
+ . then ( simulators => simulators . map ( simulatorToTarget ) )
21
+ . catch ( err => {
22
+ debug ( `There was an error getting the iOS simulator list: ${ err . message } ` ) ;
23
+ return [ ] ;
24
+ } ) ;
25
+
26
+ const [ devices , simulators ] = await Promise . all ( [ devicesPromise , simulatorsPromise ] ) ;
14
27
15
28
return list ( args , devices , simulators ) ;
16
29
}
You can’t perform that action at this time.
0 commit comments