Skip to content

Commit

Permalink
std: Make std/sh-out die if command errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Jan 21, 2025
1 parent 6a1924d commit 12eb5e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/ys/std.clj
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,11 @@
(apply process/shell (process-opts xs)))

(defn sh-out [& xs]
(str/trim-newline
(:out (apply sh xs))))
(let [ret (apply sh xs)]
(when (not= 0 (:exit ret))
(util/die (:err ret)))
(str/trim-newline
(:out ret))))


;;------------------------------------------------------------------------------
Expand Down

0 comments on commit 12eb5e0

Please sign in to comment.