Move get-process-output-lines to util-io.

This commit is contained in:
Dominik Pantůček 2023-04-08 20:56:22 +02:00
parent 4ac7fdbc6d
commit 64cd360c0d
5 changed files with 29 additions and 19 deletions

View file

@ -29,7 +29,6 @@
utils
(
filter
get-process-output-lines
utils-tests!
)
@ -51,15 +50,6 @@
(loop (cdr lst)
res)))))
;; Very simple shell command wrapper that returns lines produced by
;; given command. Dangerous - performs no argument escaping!
(define (get-process-output-lines cmd)
(let-values (((stdout stdin pid stderr) (process* cmd)))
(close-output-port stdin)
(let ((result (read-lines stdout)))
(let-values (((a b c) (process-wait pid)))
result))))
;; Performs utils module self-tests.
(define (utils-tests!)
(run-tests