Skip to content

Commit

Permalink
Don't print expr val on nil
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Aug 6, 2021
1 parent af9cc6f commit efa64a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bb.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{:tasks
{:paths ["script"]
:tasks
{:requires ([babashka.fs :as fs])
clean (fs/delete-tree "out")
watch (do (shell "npx shadow-cljs --force-spawn watch modules"))
Expand All @@ -13,6 +14,7 @@
(str "#!/usr/bin/env node\n\n" (slurp "out/nbb_main.js")))
(shell "chmod +x out/nbb_main.js")
(run! fs/delete (fs/glob "out" "**.map")))}
test nbb-tests/main
run (shell "out/nbb_main.js test.cljs")
publish {:depends [release]
:task (do (shell "npm publish")
Expand Down
2 changes: 1 addition & 1 deletion src/nbb/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
(-> (nbb/eval-string {:require require
:script-dir path} source)
(.then (fn [val]
(when expr
(when (and expr (some? val))
(prn val))
val))))
(.error js/console "Usage: nbb <script> or nbb -e <expr>."))))

0 comments on commit efa64a6

Please sign in to comment.