Skip to content

Instantly share code, notes, and snippets.

@tstout
Last active August 21, 2023 23:35
Show Gist options
  • Select an option

  • Save tstout/1ff3aa91102b81c1a84a2f57be2e5aa9 to your computer and use it in GitHub Desktop.

Select an option

Save tstout/1ff3aa91102b81c1a84a2f57be2e5aa9 to your computer and use it in GitHub Desktop.
shell exec checking for errors #clojure
(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