Remove call to main/exit and rely on exceptions #7

Merged
merged 1 commit into from Sep 7, 2012

Projects

None yet

2 participants

@hugoduncan
Contributor

Calling main/exit prevented lein sub from being used within the lein do task.
In the case of no sub-projects being defined the exit status was also being
reported as 0.

@hugoduncan hugoduncan Remove call to main/exit and rely on exceptions
Calling main/exit prevented lein sub from being used within the lein do
task. In the case of no sub-projects being defined the exit status was
also being reported as 0.
a7fb7df
@kumarshantanu
Owner

Just so I can understand -- main/exit[1] throws exception but main/apply-task[2] doesn't catch it, then how would lein-sub know that a sub-task exited without error? (Assuming the sub-task is a plugin and uses main/exit to mark its exit.)

[1] main/exit https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L45
[2] main/apply-task https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L136

Owner

@hugoduncan Thanks for the pointer, I got it -- the exception mechanism is to exit/abort within the Leiningen JVM process.

@kumarshantanu kumarshantanu merged commit 795e5bc into kumarshantanu:master Sep 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment