Add shutdown-tree

This commit is contained in:
Michiel Borkent 2021-04-12 17:37:29 +02:00
parent 80a06a62f9
commit 478dd780b7
2 changed files with 9 additions and 7 deletions

@ -1 +1 @@
Subproject commit 60743582590fdad4e7d0669f0989d1f82a75d48d
Subproject commit 5e10c172facf30e938191349883fbf27033c486c

View file

@ -13,6 +13,12 @@
(when (not (zero? exit-code))
(System/exit exit-code))))
(def default-opts
{:in :inherit
:out :inherit
:err :inherit
:shutdown p/destroy-tree})
(defn shell [cmd & args]
(let [[opts cmd args]
(if (map? cmd)
@ -25,9 +31,7 @@
opts)]
(exit-non-zero
(p/process (into (p/tokenize cmd) args)
(merge {:in :inherit
:out :inherit
:err :inherit} opts)))))
(merge default-opts opts)))))
(defn clojure [cmd & args]
(let [[opts cmd args]
@ -41,9 +45,7 @@
opts)]
(exit-non-zero
(deps/clojure (into (p/tokenize cmd) args)
(merge {:in :inherit
:out :inherit
:err :inherit} opts)))))
(merge default-opts opts)))))
(defn -wait [res]
(when res