5 lines
178 B
Clojure
5 lines
178 B
Clojure
|
;;executes shell command but throws exception on error
|
||
|
(defn- safe-sh [& commands]
|
||
|
(as-> (apply shell/sh commands) $
|
||
|
(if (= (:exit $) 0) $ (throw (Exception. (:err $))))))
|