Very cool, I just had a problem this would have solved
Can you describe the problem? This would be good feedback for something that's still under dev
I tried shelling out for deps on windows, and it was just a nightmare figuring out the quoting/escaping, etc
try using babashka.process, it has special logic for escaping args on windows
It was actually that progress-bar thing that I wanted to add in a script, so I tried to shell out to clojure deps and add that to the classpath
lol ok. yeah, babashka.deps will also solve that problem by allowing you to insert the deps map in the script itself without shelling out
but you can do this also from babashka as of now by using babashka.classpath/add-classpath
from within a script and babashka.process
to shell out
Sounds good. I was trying clojure.java.shell/sh
(-> (babashka.process/process ["clojure" "-Spath" ...] {:out :string}) :out)
will give you the classpath
correction:
(-> (babashka.process/process ["clojure" "-Spath"] {:out :string}) deref :out)
This should work on Windows given that babashka.process does some stuff to account for issues on Windows
I tried that, but I guess I have other issues, because I just get this error:
java.io.IOException: Cannot run program "clojure": CreateProcess error=2
This is with the clojure stuff installed via scoop, and I can reach them via the shell
that's because clojure
is a powershell thing in Windows.
The solution/workaround for that is to use https://github.com/borkdude/deps.clj which you can also install via scoop clojure.
And then shell out to deps
instead of clojure
gotcha
It's clear that adding babashka.deps
will give some gains here
Nice, that made it work
I wonder if that progress bar thing works on Windows btw. It's a different kind of terminal right
Yea it works. If you mess with the display format, (e.g., to display the item title you are currently processing), it breaks though (fails to clear the last line if it was longer than the next one)