Fork me on GitHub
#babashka
<
2023-10-18
>
joshuamz00:10:36

Hello. One simple question. How do you tell when a Babashka script is executed from the terminal (via #!/usr/bin/env bb) in contrast to loading the file into a nREPL session? I'd like to test and play around with the helper functions but don't want to run the main script form.

Bob B01:10:33

this section: <https://book.babashka.org/#main_file> might be what you're looking for

joshuamz01:10:48

Oh great! Thank you! I'm not sure how I skipped this section altogether

👍 1
mkvlr06:10:12

with what black magic does the self-contained binary / uberjar work? So you stuff together the binary and the uberjar into a binary and java.util.zip.ZipFile just skips that binary and looks for the the zip?

👍 1
mkvlr06:10:08

aha, TIL https://en.wikipedia.org/wiki/ZIP_(file_format) > ZIP archives can also include extra data that is not related to the ZIP archive. This allows for a ZIP archive to be made into a self-extracting archive (application that decompresses its contained data), by prepending the program code to a ZIP archive and marking the file as executable.

💡 1
mkvlr06:10:25

well very cool and useful, thanks!