I'm not in the mood of forking and pull requesting right now. But here are a couple of fixes:
diff --git a/quick b/quick
index 6b44286..381f8c6 100755
--- a/quick
+++ b/quick
@@ -80,7 +80,7 @@ def start_nrepl(port=None, toplevel=False):
port = None
while port is None and line is not None:
print(line, end='', file=sys.stderr)
- match = re.match(r"^nREPL server started on port ([0-9]+) on host ([^ ]+)$", line.rstrip())
+ match = re.match(r"^.*port ([0-9]+).*$", line.rstrip())
if match is not None:
port = int(match.group(1))
break
@@ -206,7 +206,7 @@ def repl(port=None, con=None):
# get a connection
if port is None: port = start()
if con is None:
- url = 'nrepl://localhost:%i' % (port)
+ url = 'nrepl://localhost:%i' % (int(port))
con = nrepl.connect(native_str(url))
# get a session
The addressed problems:
The port obtained from the command line is a str, not an int. You could prefer casting to int earlier when parsing the command line, as you're already converting to int the ports obtained from nrepl and from .nrepl-port. This way ports will be always ints, once parsed.
The line returned by the nrepl has now the syntax
nREPL server started on port 44879 on host 127.0.0.1 - nrepl://127.0.0.1:44879
which is not matching your regex anymore. I think it's best to just match "port " in order to avoid breakage due to future changes.
I'm not in the mood of forking and pull requesting right now. But here are a couple of fixes:
The addressed problems:
nREPL server started on port 44879 on host 127.0.0.1 - nrepl://127.0.0.1:44879
which is not matching your regex anymore. I think it's best to just match "port