Skip to content

Commit

Permalink
Fix a bug where interactive task would break upon exceptions. Fixes t…
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Nov 9, 2011
1 parent d7f2580 commit db7291e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ autodoc/
bin/nom
.lein-failures
/lein.man
/scratch.clj
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -2,6 +2,8 @@ Leiningen NEWS -- history of user-visible changes

= 1.6.2 / ???

* Fix bug where exceptions would break interactive task.

* Default to Clojure 1.3.0 for new projects.

* Allow Leiningen home to exist inside project directory. (Heinz N. Gies)
Expand Down
14 changes: 9 additions & 5 deletions src/leiningen/interactive.clj
@@ -1,6 +1,7 @@
(ns leiningen.interactive
"Enter interactive task shell."
(:require [clojure.string :as string])
(:require [clojure.string :as string]
[clojure.java.io :as io])
(:use [leiningen.core :only [apply-task exit *interactive?*]]
[leiningen.test :only [*exit-after-tests*]]
[leiningen.repl :only [repl-server repl-socket-on
Expand Down Expand Up @@ -59,14 +60,17 @@
(defn interactive
"Enter an interactive task shell. Aliased to \"int\"."
[project]
(.delete (io/file "/tmp/bugger-all"))
(let [[port host] (repl-socket-on project)]
(println welcome)
(future
(binding [*interactive?* true]
(eval-in-project project `(do ~(repl-server project host port
:prompt '(constantly ""))
;; can't stop return value from printing
(symbol "")))))
(eval-in-project project (repl-server project host port
:prompt '(fn [])
:caught '(fn [t]
(println (.getMessage t))
(.printStackTrace t)
(.close *in*))))))
(let [connect #(poll-repl-connection port 0 vector)]
(binding [eval-in-project (partial eval-in-repl connect)
*exit-after-tests* false
Expand Down
11 changes: 5 additions & 6 deletions todo.org
Expand Up @@ -12,13 +12,12 @@ See also https://github.com/technomancy/leiningen/issues
- [X] fix :omit-default-repositories wrt central (#211)
- [X] deps should run an implicit clean
- [X] don't let multiple versions of a plugin interfere with each other (#301)
- [ ] use java class for :main (#249)
- [ ] jvm-specific deps (JSR 310)
- [X] non-jar deps on classpath (#244)
- [X] recover from error in interactive (#234)
- [ ] fix deploy with new maven-ant-tasks
- [ ] use java class in run task (#249)
- [ ] signed deps for plugins (#247)
- [ ] investigate interactive failures with 1.3 (#234)
- [ ] recover from errors in repl task (#286)
- [ ] windows issues with plugin install swank (#252)
- [ ] non-jar deps on classpath (#244)
- [ ] jvm-specific deps (JSR 310)
* For 1.6.1
- [X] upgrade hooke
- [X] make it easier to use :repl-options [:print clojure.pprint/pprint]
Expand Down

0 comments on commit db7291e

Please sign in to comment.