Fork me on GitHub
#babashka
<
2021-11-07
>
Jacob Rosenzweig03:11:20

When you execute babashka from a powershell prompt, can you send commands to powershell itself or only bash? I wasn't sure how to immediately do that.

borkdude07:11:59

When shelling in bb and Java you never implicitly invoke bash or powershell. You only invoke the program that you specify. If you want to invoke powershell you should write that explicitly.

borkdude10:11:19

e.g. ["bash" "-c" "ls"]

jkrasnay14:11:00

I invoke Powershell from Babashka to invoke things installed by Scoop: (sh "powershell" "plantuml" "-tsvg" "foo.puml")

schmee11:11:33

I don’t understand this error:

----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  dir already refers to #'dir in namespace user
Phase:    analysis
the code runs fine in the REPL and I can evaluate all the forms one by one

schmee11:11:49

^ the message happens when trying to run the the script via bb

borkdude11:11:27

Need more info, e.g. the contents of http://script.bb

schmee11:11:41

it’s probably something silly

schmee11:11:01

and probably something that would be pointed out by clj-kondo if I had taken the time to set that up yet 😉

borkdude11:11:36

I know what the issue is, but this shouldn't be happening. When doing -e then bb automatically refers clojure.repl [dir] in the user namespace so you can do (dir ...) to see public vars of a namespace. But this shouldn't happen in a script.

borkdude11:11:50

To work around this you can make a (ns install-zig) on the top of your script

borkdude11:11:29

Please post an issue

schmee11:11:26

will do, thanks! :thumbsup:

borkdude11:11:59

Some exciting work going on over here: https://github.com/borkdude/tools-deps-native-experiment/pull/6 tools-deps-native pod + some enhancements in bb (see tools-build branch). Build a jar for a Clojure project in 200ms :). Example script: https://clojurians.slack.com/archives/CLX41ASCS/p1636283927230600?thread_ts=1636166363.213700&amp;cid=CLX41ASCS

$ rm -rf target
$ time bb 
bb    0.09s  user 0.06s system 69% cpu 0.217 total
$ jar -tf target/lib1-1.2.55.jar
META-INF/MANIFEST.MF
borkdude/
borkdude/tdn/
borkdude/tdn/pod.clj
borkdude/tdn/main.clj
borkdude/tdn/cli.clj

👍 2
👏 3
borkdude23:11:09

Writing a #clojure highlighter from scratch: https://blog.michielborkent.nl/writing-clojure-highlighter.html Using #babashka of course :)

🆒 3
1
👏 1
ambrosebs17:11:34

That's badass!