Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Wrong exit status #1

Closed
myfreeweb opened this Issue · 5 comments

2 participants

@myfreeweb

lein-sub doesn't currently work for me because it doesn't carry exit codes from tasks, so if I have failed tests on some of the subprojects it will still exit with 0 and CI will count the build as successful.

@kumarshantanu

I have pushed the fix to master, which should hopefully work. Can you try it out from there? The version number is 0.1.1-SNAPSHOT in project.clj now.

@myfreeweb

Leiningen isn't that smart. Returning a number 1 won't work. I think you should use leiningen.core/exit

@myfreeweb

Oh wait, I've had 0.1 on my classpath. Now, fixing a stupid mistake:

From 99bb0f2321db13d553399dae7e6325d95453f81e Mon Sep 17 00:00:00 2001
From: myfreeweb <me@myfreeweb.ru>
Date: Sun, 16 Oct 2011 14:11:36 +0400
Subject: [PATCH] fix

---
 src/leiningen/sub.clj |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/leiningen/sub.clj b/src/leiningen/sub.clj
index 30c3614..643b96b 100644
--- a/src/leiningen/sub.clj
+++ b/src/leiningen/sub.clj
@@ -4,8 +4,8 @@


 (defn run-sub-proj
-  [sub-proj-dir]
-  (println "Reading project from " sub-proj-dir)
+  [sub-proj-dir task-name args]
+  (println "Reading project from" sub-proj-dir)
   (let [sub-project (read-project (str sub-proj-dir "/project.clj"))]
     (apply-task task-name sub-project args task-not-found)))

@@ -23,5 +23,5 @@ Note: Each sub-project directory should have its own project.clj file")
                               (let [a (if (= 0 a) nil a)
                                     b (if (= 0 b) nil b)]
                                 (or a b)))
-                            (map run-sub-proj (:sub project)))]
+                            (map #(run-sub-proj % task-name args) (:sub project)))]
       (exit code))))
-- 
1.7.7

@myfreeweb

Cool, thanks. Don't forget to deploy it to clojars!

@myfreeweb myfreeweb closed this
@kumarshantanu

Thanks! Pushed 0.1.1 to Clojars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.