Add shutdown-tree
This commit is contained in:
parent
80a06a62f9
commit
478dd780b7
2 changed files with 9 additions and 7 deletions
2
deps.clj
2
deps.clj
|
|
@ -1 +1 @@
|
||||||
Subproject commit 60743582590fdad4e7d0669f0989d1f82a75d48d
|
Subproject commit 5e10c172facf30e938191349883fbf27033c486c
|
||||||
|
|
@ -13,6 +13,12 @@
|
||||||
(when (not (zero? exit-code))
|
(when (not (zero? exit-code))
|
||||||
(System/exit exit-code))))
|
(System/exit exit-code))))
|
||||||
|
|
||||||
|
(def default-opts
|
||||||
|
{:in :inherit
|
||||||
|
:out :inherit
|
||||||
|
:err :inherit
|
||||||
|
:shutdown p/destroy-tree})
|
||||||
|
|
||||||
(defn shell [cmd & args]
|
(defn shell [cmd & args]
|
||||||
(let [[opts cmd args]
|
(let [[opts cmd args]
|
||||||
(if (map? cmd)
|
(if (map? cmd)
|
||||||
|
|
@ -25,9 +31,7 @@
|
||||||
opts)]
|
opts)]
|
||||||
(exit-non-zero
|
(exit-non-zero
|
||||||
(p/process (into (p/tokenize cmd) args)
|
(p/process (into (p/tokenize cmd) args)
|
||||||
(merge {:in :inherit
|
(merge default-opts opts)))))
|
||||||
:out :inherit
|
|
||||||
:err :inherit} opts)))))
|
|
||||||
|
|
||||||
(defn clojure [cmd & args]
|
(defn clojure [cmd & args]
|
||||||
(let [[opts cmd args]
|
(let [[opts cmd args]
|
||||||
|
|
@ -41,9 +45,7 @@
|
||||||
opts)]
|
opts)]
|
||||||
(exit-non-zero
|
(exit-non-zero
|
||||||
(deps/clojure (into (p/tokenize cmd) args)
|
(deps/clojure (into (p/tokenize cmd) args)
|
||||||
(merge {:in :inherit
|
(merge default-opts opts)))))
|
||||||
:out :inherit
|
|
||||||
:err :inherit} opts)))))
|
|
||||||
|
|
||||||
(defn -wait [res]
|
(defn -wait [res]
|
||||||
(when res
|
(when res
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue