Last active
August 21, 2023 23:35
-
-
Save tstout/1ff3aa91102b81c1a84a2f57be2e5aa9 to your computer and use it in GitHub Desktop.
shell exec checking for errors #clojure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns an.example | |
| (:require [clojure.java.shell :as shell] | |
| (defn sh-exec [arg-vec] | |
| (let [{:keys [exit err]} | |
| (shell/with-sh-dir (mk-staging-dir) | |
| (apply shell/sh arg-vec))] | |
| (when-not (zero? exit) | |
| (throw (Exception. err))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment