mirror of
https://github.com/status-im/re-natal.git
synced 2025-02-28 04:00:34 +00:00
write natal config file
This commit is contained in:
parent
0314e730e5
commit
6cfeb64234
14
main.coffee
14
main.coffee
@ -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'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user