planck

Planck ClojureScript REPL
stijn 2016-12-02T10:45:36.000567Z

hi, I have a basic question on Planck: when executing a shell command, how can you return from the script into your shell with :err going to stderr, :out going to stdout?

mfikes 2016-12-02T13:21:28.000568Z

@stijn ClojureScript defines *print-err-fn* and Planck sets this up to go to stderr. So, with foo.cljs

(*print-err-fn* "stderr")
(*print-fn* “stdout”)
and then planck foo.cljs 2> /tmp/stderr.txt you will see that stdout is printed on your terminal while the stderr is redirected to the file. With this you could do something along the lines of (*print-err-fn* (:err sh-result)) and similarly with stdout, and then (planck.core/exit 0)

stijn 2016-12-02T14:22:55.000569Z

thanks @mfikes!