Fork me on GitHub
#tools-deps
<
2020-11-28
>
winkywooster17:11:04

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?

dominicm18:11:01

The shebang won't work on Linux, so don't do that

borkdude18:11:00

Yep. The ericnormand example should work correctly on linux and macOS

borkdude18:11:58

But not on Windows, because Windows doesn't have shebangs

dominicm18:11:16

There's a Monroe shebang around somewhere that also works on both.

borkdude18:11:30

That's why you should write a babashka script to launch Clojure cross platform ;P

borkdude18:11:16

I think you could pull that off with environment variables

borkdude18:11:02

oh right, because strings are just constants :)

borkdude19:11:18

Cross platform launcher script. Should work on linux, macos and Windows: https://github.com/babashka/book/issues/8

borkdude19:11:04

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

👍 3
borkdude19:11:23

You could also do this with JVM Clojure only, but then it's slightly slower because of the startup of the first JVM