This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-20
Channels
- # announcements (3)
- # babashka (7)
- # beginners (43)
- # biff (19)
- # calva (39)
- # cider (16)
- # clerk (2)
- # clj-yaml (32)
- # cljs-dev (37)
- # clojure (129)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (46)
- # clojure-filipino (1)
- # clojure-gamedev (25)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (2)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (5)
- # clojure-norway (8)
- # clojure-sg (1)
- # clojure-sweden (12)
- # clojure-taiwan (1)
- # clojure-uk (9)
- # clojurescript (14)
- # core-typed (136)
- # cursive (18)
- # duct (9)
- # emacs (12)
- # etaoin (7)
- # events (1)
- # graalvm (3)
- # gratitude (2)
- # humbleui (7)
- # hyperfiddle (99)
- # introduce-yourself (5)
- # jobs (2)
- # leiningen (1)
- # missionary (14)
- # nrepl (2)
- # off-topic (12)
- # polylith (21)
- # rdf (29)
- # re-frame (8)
- # releases (1)
- # shadow-cljs (264)
- # spacemacs (21)
- # sql (7)
- # vscode (1)
Hey team, one more question.
is there a way I can make my babashka script -main
when executing, without explicitly invoking -main in the file?
Context:
ā¢ I love being edit the script in conjure. But if I weI love being to edit the script in conjure. But if I evaled
the whole file, it would end up running the script, which I don't want
You can check if the current file is the file babashka was asked to execute. Example from my code: https://github.com/teodorlu/play.teod.eu/blob/ba8cc73f0aeb701c6c277cbd7879a2ed06d09956/play.clj#L5 Then your code works both as a script (-main is executed) and as a library (-main is not executed)
> This can be exceedingly handy for editing complex scripts interactively, while not being able to adjust how they are invoked by other tools.