diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 106acfa2..99beb7f0 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -524,7 +524,8 @@ Use -- to separate script command line args from bb command line args. [nil (-> (p/process args {:inherit true}) p/check - :exit)])})) + :exit)])}) + (error (str "No such task: " (:task/type task)) 1)) (error (str "No such task: " task) 1)) (error (str "File does not exist: " task) 1))) diff --git a/test-resources/bb.edn b/test-resources/bb.edn index b0a25d84..a8b1cbb5 100644 --- a/test-resources/bb.edn +++ b/test-resources/bb.edn @@ -16,4 +16,17 @@ :args [:do :count-files :__ :bash "ls | wc -l" :__ :eval-plus 1 2 3 - :__ :describe]}}} + :__ :describe]} + ;;;; + :failing-shell {:task/type :babashka + ;; we are executing a shell task, yet we are continueing despite the error code + :args [-e (-> (do (deref (babashka.process/process ["ls" "foobar"] {:inherit true})) + (deref (babashka.process/process ["echo" "done"] {:inherit true})) + nil))]} + :print-hello {:task/type :babashka + :args [-e (println :hello)]} + :composed-failing {:task/type :babashka + :args [:do :failing-shell + :__ :print-hello]} + ,} + }