Skip to content

Commit 12eb5e0

Browse files
committed
std: Make std/sh-out die if command errors
1 parent 6a1924d commit 12eb5e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/ys/std.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,11 @@
853853
(apply process/shell (process-opts xs)))
854854

855855
(defn sh-out [& xs]
856-
(str/trim-newline
857-
(:out (apply sh xs))))
856+
(let [ret (apply sh xs)]
857+
(when (not= 0 (:exit ret))
858+
(util/die (:err ret)))
859+
(str/trim-newline
860+
(:out ret))))
858861

859862

860863
;;------------------------------------------------------------------------------

0 commit comments

Comments
 (0)