From 0a2cea37196a4cc35063b1b819366ccadb145d86 Mon Sep 17 00:00:00 2001 From: Dan Motzenbecker Date: Sat, 14 Nov 2015 18:18:19 -0500 Subject: [PATCH] generateConfig() --- natal.coffee | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/natal.coffee b/natal.coffee index a4ef3b6..61a5eae 100644 --- a/natal.coffee +++ b/natal.coffee @@ -104,6 +104,16 @@ ensureFreePort = (cb) -> cb() +generateConfig = (name) -> + log 'Creating Natal config' + config = + name: name + device: getUuidForDevice 'iPhone 6s' + + writeConfig config + config + + writeConfig = (config) -> try fs.writeFileSync '.natal', JSON.stringify config, null, 2 @@ -299,14 +309,8 @@ init = (projName, interfaceName) -> ] ] - log 'Creating Natal config' process.chdir '../..' - config = - name: projName - device: pluckUuid getDeviceList().find (line) -> /iPhone 6/.test line - - writeConfig config - launch config + launch generateConfig projName log '' log 'To get started with your new app, first cd into its directory:', 'yellow'