pass name as arg
This commit is contained in:
parent
151d9f6c4e
commit
95baffdb9e
18
main.coffee
18
main.coffee
|
@ -1,3 +1,9 @@
|
|||
# Natal
|
||||
# Bootstrap ClojureScript React Native apps
|
||||
# Dan Motzenbecker
|
||||
# http://oxism.com
|
||||
# MIT License
|
||||
|
||||
fs = require 'fs'
|
||||
crypto = require 'crypto'
|
||||
{execSync} = require 'child_process'
|
||||
|
@ -124,6 +130,8 @@ init = (projName) ->
|
|||
log 'Try this command as an example:', 'yellow'
|
||||
log '(swap! app-state assoc :text "Hello Native World")', 'inverse'
|
||||
log ''
|
||||
log '✔ Done', 'bgMagenta'
|
||||
log ''
|
||||
|
||||
|
||||
catch e
|
||||
|
@ -137,3 +145,13 @@ init = (projName) ->
|
|||
logErr e.message
|
||||
|
||||
process.exit 1
|
||||
|
||||
|
||||
[_, _, name] = process.argv
|
||||
|
||||
unless name
|
||||
logErr 'You must pass a project name as the first argument.'
|
||||
logErr 'e.g. natal HelloWorld'
|
||||
process.exit 1
|
||||
|
||||
init name
|
||||
|
|
Loading…
Reference in New Issue