Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

feat(mage): add port option to mage nrepl (#62224)

Edward Pagetf11e8248d048
diff --git a/bb.edn b/bb.edn
index b8c92b31bac..d40c9ce1e66 100644
--- a/bb.edn
+++ b/bb.edn
@@ -109,11 +109,15 @@
{:doc "Starts the babashka nrepl: helpful for mage development"
:requires [[babashka.nrepl.server :as nrepl.server]
[mage.color :as c]]
- :examples [["./bin/mage nrepl" "Starts the nrepl server"]]
+ :examples [["./bin/mage nrepl" "Starts the nrepl server"]
+ ["./bin/mage nrepl --port 50506" "Starts the nrepl server"]
+ ["./bin/mage nrepl -p 50506" "Starts the nrepl server"]]
+ :options [["-p" "--port PORT" "optionally provide a port to run the nrepl server on" :default 1667 :parse-fn Integer/parseInt]]
:task (task!
- (spit ".nrepl-port" 1667)
- (nrepl.server/start-server!)
- (deref (promise)))}
+ (let [{:keys [port]} (:options parsed)]
+ (spit ".nrepl-port" port)
+ (nrepl.server/start-server! {:port port})
+ (deref (promise))))}
lint-migrations
{:doc "Lint migrations files"