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