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))
|
||||
(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
|
||||
|
|
|
|||
Loading…
Reference in a new issue