This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-02
Channels
- # adventofcode (76)
- # announcements (1)
- # asami (1)
- # babashka (31)
- # beginners (302)
- # calva (3)
- # cider (1)
- # clj-kondo (1)
- # cljdoc (1)
- # cljfx (63)
- # cljsjs (2)
- # clojure (36)
- # clojure-europe (29)
- # clojure-gamedev (2)
- # clojure-nl (5)
- # clojure-sanfrancisco (2)
- # clojure-spec (2)
- # clojure-uk (71)
- # clojurescript (19)
- # conjure (21)
- # core-async (10)
- # core-matrix (1)
- # cryogen (4)
- # cursive (12)
- # datomic (22)
- # emacs (4)
- # events (1)
- # figwheel-main (7)
- # fulcro (9)
- # graalvm (1)
- # jobs (1)
- # kaocha (17)
- # lambdaisland (1)
- # meander (7)
- # mount (2)
- # nrepl (12)
- # off-topic (35)
- # re-frame (15)
- # reagent (17)
- # remote-jobs (1)
- # reveal (41)
- # shadow-cljs (13)
- # spacemacs (2)
- # tools-deps (24)
Hello everyone 馃檪 I wonder if it was possible when using the cli command to evaluate code in the nrepl server? I would like to run the djblue/portal commands on start.
Not sure, I don't think so, but one option would be to do something like this:
位 cat deps.edn
{:deps {nrepl/nrepl {:mvn/version "0.8.3"}
djblue/portal {:mvn/version "0.6.4"}}}
位 cat src/user.clj
(ns user
(:require [portal.api :as p]))
(p/open)
(p/tap)
位 clojure -M -m nrepl.cmdline
nREPL server started on port 61861 on host localhost -
thanks!
Or https://github.com/gfredericks/user.clj if you don't want to do it per-project.
(I would probably have a function in user.clj
that calls p/open
and p/tap
instead of calling them on the top level, but YMMV.)
agrees
Looks like there's a ticket for that: https://clojure.atlassian.net/browse/CLJ-2240
Thanks
You can also add (.addShutdownHook (Runtime/getRuntime) (Thread. #(p/close)))
to user.clj for cleanup
@neo2551 You can also check out https://github.com/eraserhd/rep
This can also be accomplished with babashka. https://book.babashka.org/#_interacting_with_an_nrepl_server