write natal config file

This commit is contained in:
Dan Motzenbecker 2015-09-19 14:02:28 -04:00
parent 0314e730e5
commit 6cfeb64234

View File

@ -35,6 +35,17 @@ editSync = (path, pairs) ->
, fs.readFileSync path, encoding: 'ascii' , fs.readFileSync path, encoding: 'ascii'
writeConfig = (config) ->
try
fs.writeFileSync '.natal', JSON.stringify config, null, 2
catch {message}
logErr \
if message.match /EACCES/i
'Invalid write permissions for creating .natal config file'
else
message
init = (projName) -> init = (projName) ->
projNameHyph = projName.replace(camelRx, '$1-$2').toLowerCase() projNameHyph = projName.replace(camelRx, '$1-$2').toLowerCase()
projNameUs = projName.replace(camelRx, '$1_$2').toLowerCase() projNameUs = projName.replace(camelRx, '$1_$2').toLowerCase()
@ -142,8 +153,9 @@ init = (projName) ->
] ]
] ]
log 'Creating Natal config'
process.chdir '../..' process.chdir '../..'
openXcode projName writeConfig name: projName
log '\nWhen Xcode appears, click the play button to run the app on the simulator.', 'yellow' log '\nWhen Xcode appears, click the play button to run the app on the simulator.', 'yellow'
log 'Then run the following for an interactive workflow:', 'yellow' log 'Then run the following for an interactive workflow:', 'yellow'