Permalink
Browse files

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

Fix test-execute by wrapping *err* Writer in a PrintWriter
  • Loading branch information...
2 parents 4dbb657 + 77c1298 commit d54a813723c01ffa7a074454582fe112ee9213b8 @technomancy committed Oct 31, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −1 src/mire/commands.clj
  2. +3 −1 src/mire/server.clj
@@ -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!")))
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))))))

0 comments on commit d54a813

Please sign in to comment.