Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix a bug where interactive task would break upon exceptions. Fixes #269

.
  • Loading branch information...
commit db7291e24509b1d282434fd290fcd3c44947a305 1 parent d7f2580
@technomancy authored
Showing with 17 additions and 11 deletions.
  1. +1 −0  .gitignore
  2. +2 −0  NEWS
  3. +9 −5 src/leiningen/interactive.clj
  4. +5 −6 todo.org
View
1  .gitignore
@@ -10,3 +10,4 @@ autodoc/
bin/nom
.lein-failures
/lein.man
+/scratch.clj
View
2  NEWS
@@ -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)
View
14 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
@@ -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
View
11 todo.org
@@ -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]
Please sign in to comment.
Something went wrong with that request. Please try again.