I am really enjoying Planck. I’m working on packaging deps for use with bootstrapped cljs in the browser, and it is a huge help, both for the workflow & the many examples of working w/ the self-hosted compiler in the source.
One question about loading planck scripts using #!/usr/bin/env planck
— how can one pass command-line arguments to Planck? I can access the args in my script, but i also need to provide planck w/ a classpath and cache-dir.
@mhuebert I haven't tried it, but it's my understanding that you'll get them in *command-line-args*
@anmonteiro command-line-args works perfectly for accessing args for my script; however, I also need to pass args to planck. eg/ in ./my-script.cljs -K, the -K arg is for planck. Pretty sure this is about my lack of unix knowledge and not planck!
http://sambal.org/2014/02/passing-options-node-shebang-line/
^ I think this is along the lines of what I’m looking at
oh, then I also have lack of UNIX knowledge to help there 🙂
sorry
thanks anyway 🙂
@anmonteiro and btw I’m looking forward to your talk tomorrow!
I suppose I'll see you tomorrow then 🙂
hmm. This is tricky, using the idea from that link I am able to pass some args to planck, but if I pass any other unexpected args, planck throws an ‘unrecognized option’ error
I can do something like this:
#!/bin/sh
":"; exec /usr/bin/env planck -i "$0" -c `lein classpath` -K
but the original command line args are lost.OK, got it:
#!/bin/sh
":"; exec /usr/bin/env planck -c `lein classpath` -K "$0" "$@“
from the planck cli docs: Binds planck.core/*command-line-args* to a seq of strings containing command line args that appear after any main option
. In the example above, “$0”, which is the path to the script we are running, must be passed at the end (as a naked ‘path’ option) instead of with the -i
option.