From 944324f9822f159ab77ca8fa68ebb70d56b6be1d Mon Sep 17 00:00:00 2001 From: Dan Motzenbecker Date: Sat, 17 Oct 2015 00:37:20 -0400 Subject: [PATCH] convert project name to underscored path in repl script --- natal.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/natal.coffee b/natal.coffee index 06a557c..217d882 100644 --- a/natal.coffee +++ b/natal.coffee @@ -53,6 +53,10 @@ pluckUuid = (line) -> line.match(/\[(.+)\]/)[1] +toUnderscored = (s) -> + s.replace(camelRx, '$1_$2').toLowerCase() + + writeConfig = (config) -> try fs.writeFileSync '.natal', JSON.stringify config, null, 2 @@ -105,7 +109,7 @@ getBundleId = (name) -> init = (projName) -> projNameHyph = projName.replace(camelRx, '$1-$2').toLowerCase() - projNameUs = projName.replace(camelRx, '$1_$2').toLowerCase() + projNameUs = toUnderscored projName try log "Creating #{projName}", 'bgMagenta' @@ -354,7 +358,7 @@ startRepl = (name) -> :watch-fn (fn [] (cljs.repl/load-file repl-env - \"src/#{name}/core.cljs\")) + \"src/#{toUnderscored name}/core.cljs\")) :analyze-path \"src\")) """), cwd: process.cwd()