File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 219219 :escape default-escape
220220 :program-resolver default-program-resolver })
221221
222- (defn- normalize-opts [{:keys [:out :err :in :inherit ] :as opts}]
222+ (def ^java.io.File null-file
223+ (delay (io/file (if windows?
224+ " NUL"
225+ " /dev/null" ))))
226+
227+ (defn- normalize-opts [{:keys [out err in inherit] :as opts}]
223228 (cond-> opts
224229 (and inherit (not out))
225230 (-> (assoc :out :inherit ))
265270 :inherit (.redirectOutput pb ProcessBuilder$Redirect/INHERIT)
266271 :write (.redirectOutput pb (ProcessBuilder$Redirect/to (io/file (str out-file))))
267272 :append (.redirectOutput pb (ProcessBuilder$Redirect/appendTo (io/file (str out-file))))
273+ :discard (.redirectOutput pb (if-before-jdk8
274+ (ProcessBuilder$Redirect/to @null-file)
275+ ProcessBuilder$Redirect/DISCARD))
268276 nil )
269277 (case err
270278 :out (.redirectErrorStream pb true )
271279 :inherit (.redirectError pb ProcessBuilder$Redirect/INHERIT)
272280 :write (.redirectError pb (ProcessBuilder$Redirect/to (io/file (str err-file))))
273281 :append (.redirectError pb (ProcessBuilder$Redirect/appendTo (io/file (str err-file))))
282+ :discard (.redirectOutput pb (if-before-jdk8
283+ (ProcessBuilder$Redirect/to @null-file)
284+ ProcessBuilder$Redirect/DISCARD))
274285 nil )
275286 (case in
276287 :inherit (.redirectInput pb ProcessBuilder$Redirect/INHERIT)
You can’t perform that action at this time.
0 commit comments