Fork me on GitHub
#babashka
<
2023-10-03
>
Matthew Twomey15:10:30

Easiest way to get the full path of the currently executing babashka script? (from within that script obvs)

borkdude15:10:14

Same as in Clojure.

(ns my-script)

(def current-file *file*)
to get the absolute path, use (fs/absolutize current-file) or so

Matthew Twomey15:10:32

Awesome, you’re the best!

borkdude15:10:33

DO NOT refer to *file* in a function body, this variable is only bound during analysis of the file

til 4
Matthew Twomey15:10:44

Ok - got it 👍