Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

connect to nreplds:/// URIS from shell using lein nreplds. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ and use the standard `clojure.tools.nrepl/url-connect` with a URI like
`nreplds:///path/to/sock.sock`. Because of an implementation detail the path must
be absolute.

To add `nreplds:///` URIs to `lein repl`, add `[lein-nreplds "0.1"]` to your
leiningen plugins. Now you can connect to a UDS using `lein repl :connect
To connect to `nreplds:///` URIs from shell, add `[lein-nreplds "0.1.1"]` to your
leiningen plugins. Now you can connect to a UDS using `lein nreplds :connect
nreplds:///path/to/sock.sock`. Because of an implementation detail the path must
be absolute.
be absolute. This connection to `nreplds:///` from shell only tested in leiningen 2.4.2.

Forwarding a UDS over SSH
=========================
Expand Down
2 changes: 1 addition & 1 deletion lein-nreplds/project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject lein-nreplds "0.1"
(defproject lein-nreplds "0.1.1"
:description "Unix domain socket support for nREPL"
:url "https://github.com/monsanto/nreplds"
:license {:name "Eclipse Public License"
Expand Down
4 changes: 0 additions & 4 deletions lein-nreplds/src/lein_nreplds/plugin.clj

This file was deleted.

16 changes: 16 additions & 0 deletions lein-nreplds/src/leiningen/nreplds.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(ns leiningen.nreplds
(require [robert.hooke]
[leiningen.repl]))

(defn skip-ensure-port-number
"leiningen version 2.4.2 (at least) use ensure-port to force port number usage. this hook skip the execution."
[f s]
s)

(defn ^:no-project-needed nreplds
[project & args]
(robert.hooke/with-scope
(robert.hooke/add-hook #'leiningen.repl/ensure-port #'leiningen.nreplds/skip-ensure-port-number)
(apply leiningen.repl/repl project args)
))