Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from rbrainard/hotfix/test-execute

Fix test-execute by wrapping *err* Writer in a PrintWriter
  • Loading branch information...
commit d54a813723c01ffa7a074454582fe112ee9213b8 2 parents 4dbb657 + 77c1298
Phil Hagelberg authored
Showing with 4 additions and 2 deletions.
  1. +1 −1  src/mire/commands.clj
  2. +3 −1 src/mire/server.clj
2  src/mire/commands.clj
View
@@ -112,5 +112,5 @@
(try (let [[command & args] (.split input " +")]
(apply (commands command) args))
(catch Exception e
- (.printStackTrace e *err*)
+ (.printStackTrace e (new java.io.PrintWriter *err*))
"You can't do that!")))
4 src/mire/server.clj
View
@@ -23,7 +23,8 @@
(defn- mire-handle-client [in out]
(binding [*in* (reader in)
- *out* (writer out)]
+ *out* (writer out)
+ *err* (writer System/err)]
;; We have to nest this in another binding call instead of using
;; the one above so *in* and *out* will be bound to the socket
@@ -40,6 +41,7 @@
(try (loop [input (read-line)]
(when input
(println (execute input))
+ (.flush *err*)
(print prompt) (flush)
(recur (read-line))))
(finally (cleanup))))))
Please sign in to comment.
Something went wrong with that request. Please try again.