modified init to support lib selection
This commit is contained in:
parent
e5ef249fb9
commit
f37afe5d99
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue