mirror of
https://github.com/status-im/re-natal.git
synced 2025-02-27 19:50:31 +00:00
added listdevices task
This commit is contained in:
parent
4af684c5b8
commit
84dc728066
22
main.coffee
22
main.coffee
@ -213,6 +213,16 @@ openXcode = (name) ->
|
|||||||
message
|
message
|
||||||
|
|
||||||
|
|
||||||
|
getDeviceList = ->
|
||||||
|
try
|
||||||
|
execSync 'xcrun instruments -s'
|
||||||
|
.toString()
|
||||||
|
.split '\n'
|
||||||
|
.filter (line) -> /^i/.test line
|
||||||
|
catch {message}
|
||||||
|
logErr 'Device listing failed: ' + message
|
||||||
|
|
||||||
|
|
||||||
cli.version '0.0.4'
|
cli.version '0.0.4'
|
||||||
|
|
||||||
cli.command 'init <name>'
|
cli.command 'init <name>'
|
||||||
@ -227,10 +237,22 @@ cli.command 'init <name>'
|
|||||||
|
|
||||||
init name
|
init name
|
||||||
|
|
||||||
|
cli.command 'launch'
|
||||||
|
.description 'Run project in simulator and start REPL'
|
||||||
|
.action ->
|
||||||
|
launch readConfig()
|
||||||
|
|
||||||
cli.command 'xcode'
|
cli.command 'xcode'
|
||||||
.description 'Open Xcode project'
|
.description 'Open Xcode project'
|
||||||
.action ->
|
.action ->
|
||||||
openXcode readConfig().name
|
openXcode readConfig().name
|
||||||
|
|
||||||
|
cli.command 'listdevices'
|
||||||
|
.description 'List available simulator devices by index'
|
||||||
|
.action ->
|
||||||
|
console.log (getDeviceList()
|
||||||
|
.map (line, i) -> "#{i}\t#{line}"
|
||||||
|
.join '\n')
|
||||||
|
|
||||||
|
|
||||||
cli.parse process.argv
|
cli.parse process.argv
|
||||||
|
Loading…
x
Reference in New Issue
Block a user