Skip to content

Instantly share code, notes, and snippets.

@micha
Created December 28, 2014 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micha/df72b821f4347ae9aab1 to your computer and use it in GitHub Desktop.
Save micha/df72b821f4347ae9aab1 to your computer and use it in GitHub Desktop.
(ns boot.repl-client
(:require
[reply.main :as reply]))
(def default-opts {:color true :history-file ".nrepl-history"})
(defn client [opts]
(let [p (or (:port opts) (try (slurp ".nrepl-port") (catch Throwable _)))
h (or (:host opts) "127.0.0.1")]
(assert (and h p) "host and/or port not specified for REPL client")
(-> default-opts (assoc :attach (str h ":" p)) (merge opts) reply/launch-nrepl)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment