planck

Planck ClojureScript REPL
2018-02-08T15:34:48.000152Z

Does anyone know how to get planck, deps.edn, and a shebang (`#!`) to work nicely together? The start of my file looks like this:

#!/usr/bin/env planck -c `/usr/bin/env clojure -Spath`
which I would expect to run planck -c src:/Users/bmaddy/.m2/repository/org/clojure..., but I think it's actually running this:
planck -c \`/usr/bin/env clojure -Spath\`
(where the backticks aren't evaluated)

2018-02-08T15:39:38.000733Z

I think the problem is that env only allows one argument...

2018-02-08T15:54:11.000305Z

Oh geez, I just need to use a helper bash script. That was silly.

#!/bin/bash

/usr/bin/env planck -c `/usr/bin/env clojure -Spath` my-script.cljs "$@"

mfikes 2018-02-08T18:48:19.000592Z

Interesting @bmaddy, my guess is that backticks have no meaning when put in the shebang line

2018-02-08T18:55:54.000549Z

I know that under linux the shebang line is sent directly to the program, without shell parsing - which means an attempt to send multiple arguments, or any shell substitution, results in the raw input including spaces backticks dollar signs etc. being sent directly to the program as a single unmodified argument

2018-02-08T18:56:01.000337Z

OSX behaves differently

mfikes 2018-02-08T18:57:12.000397Z

Ahh, right. There’s that too. I have a branch of Planck that will run the clojure tool on your behalf. That might make sense if helper scripts get to be too unwieldy.

2018-02-08T20:02:47.000716Z

Having a helper script actually works out pretty well for me. Thanks for the thoughts though!