[doc] set classpath in the nrepl helper script (#539) [skip ci]

In the suggested helper script for starting the nrepl server, set the classpath to include `src` and `test` dirs, so that :require works correctly when the script is run from the project root.
This commit is contained in:
j-cr 2020-08-18 12:44:08 +05:00 committed by GitHub
parent 20171c59d3
commit ed25e10d55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,7 +99,9 @@ you can easily write a script that launches the server and writes the file:
(require '[babashka.wait :as wait]) (require '[babashka.wait :as wait])
(let [nrepl-port (with-open [sock (ServerSocket. 0)] (.getLocalPort sock)) (let [nrepl-port (with-open [sock (ServerSocket. 0)] (.getLocalPort sock))
pb (doto (ProcessBuilder. (into ["bb" "--nrepl-server" (str nrepl-port)] cp (str/join File/pathSeparatorChar ["src" "test"])
pb (doto (ProcessBuilder. (into ["bb" "--nrepl-server" (str nrepl-port)
"--classpath" cp]
*command-line-args*)) *command-line-args*))
(.redirectOutput ProcessBuilder$Redirect/INHERIT)) (.redirectOutput ProcessBuilder$Redirect/INHERIT))
proc (.start pb)] proc (.start pb)]