I swore I saw an example of a clojure shell script that included the deps.edn in the file itself, but no amount of googling is turning anything up. Was I dreaming, or is it possible?
https://gist.github.com/ericnormand/6bb4562c4bc578ef223182e3bb1e72c5
or if you need oneliner https://gist.github.com/nbardiuk/166dc6695bf55a351fa3070fd4065b8a
Awesome! Thanks @nbardiuk
The shebang won't work on Linux, so don't do that
Yep. The ericnormand example should work correctly on linux and macOS
But not on Windows, because Windows doesn't have shebangs
There's a Monroe shebang around somewhere that also works on both.
That's why you should write a babashka script to launch Clojure cross platform ;P
https://clojure.org/guides/faq#clj_standalone here you are :)
I think you could pull that off with environment variables
oh right, because strings are just constants :)
Cross platform launcher script. Should work on linux, macos and Windows: https://github.com/babashka/book/issues/8
I just found a cross platform way (which really means: also works on Windows) to the single script with deps "exec"
bash trick to invoke a Clojure JVM script, using babashka:
https://github.com/babashka/book/issues/8
You could also do this with JVM Clojure only, but then it's slightly slower because of the startup of the first JVM