Skip to content
Browse files

Allow suppressing of leiningen.core.main/exit for IDEs/tools.

  • Loading branch information...
1 parent 1370be9 commit d6fdc216482027c6cb7d123ec61f95bf56482a23 @technomancy committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 leiningen-core/src/leiningen/core/main.clj
View
10 leiningen-core/src/leiningen/core/main.clj
@@ -11,11 +11,17 @@
"tutorial" ["help" "tutorial"]
"sample" ["help" "sample"]}))
+(def ^:dynamic *exit-process?*
+ "Bind to false to suppress process termination." true)
+
(defn exit
- "Call System/exit. Defined as a function so that rebinding is possible."
+ "Exit the process. Rebind *exit-process?* in order to suppress actual process
+ exits for tools which may want to continue operating."
([code]
(shutdown-agents)
- (System/exit code))
+ (if *exit-process?*
+ (System/exit code)
+ code))
([] (exit 0)))
(defn abort

0 comments on commit d6fdc21

Please sign in to comment.
Something went wrong with that request. Please try again.