modified init to support lib selection

This commit is contained in:
Dan Motzenbecker 2015-10-31 11:35:07 -04:00
parent e5ef249fb9
commit f37afe5d99
1 changed files with 6 additions and 3 deletions

View File

@ -144,7 +144,7 @@ getBundleId = (name) ->
logErr message logErr message
init = (projName) -> init = (projName, lib) ->
projNameHyph = projName.replace(camelRx, '$1-$2').toLowerCase() projNameHyph = projName.replace(camelRx, '$1-$2').toLowerCase()
projNameUs = toUnderscored projName projNameUs = toUnderscored projName
@ -173,11 +173,14 @@ init = (projName) ->
log 'Updating Leiningen project' log 'Updating Leiningen project'
process.chdir projNameHyph process.chdir projNameHyph
exec "cp #{resources}project.clj project.clj" exec "cp #{resources}project.clj project.clj"
edit 'project.clj', [[projNameHyphRx, projNameHyph]] edit \
'project.clj',
[[projNameHyphRx, projNameHyph], [/\$CLJS_REACT_LIB\$/, reactLibs[lib]]]
corePath = "src/#{projNameUs}/core.clj" corePath = "src/#{projNameUs}/core.clj"
fs.unlinkSync corePath fs.unlinkSync corePath
corePath += 's' corePath += 's'
exec "cp #{resources}core.cljs #{corePath}" exec "cp #{resources}#{lib}.cljs #{corePath}"
edit corePath, [[projNameHyphRx, projNameHyph], [projNameRx, projName]] edit corePath, [[projNameHyphRx, projNameHyph], [projNameRx, projName]]
log 'Compiling ClojureScript' log 'Compiling ClojureScript'