From afb70bace0dccf5f17f744cd73a13b6b0c36ede8 Mon Sep 17 00:00:00 2001 From: Dan Motzenbecker Date: Sat, 3 Oct 2015 22:36:46 -0400 Subject: [PATCH] added setdevice command --- main.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.coffee b/main.coffee index 1d6b918..b2831ac 100644 --- a/main.coffee +++ b/main.coffee @@ -289,6 +289,16 @@ cli.command 'listdevices' .map (line, i) -> "#{i}\t#{line.replace /\[.+\]/, ''}" .join '\n') +cli.command 'setdevice ' + .description 'Choose simulator device by index' + .action (index) -> + unless device = getDeviceList()[parseInt index, 10] + logErr 'Invalid device index. Run natal listdevices for valid indexes.' + + config = readConfig() + config.device = pluckUuid device + writeConfig config + unless semver.satisfies process.version[1...], nodeVersion logErr """