Simple do function to spawn processes.
This commit is contained in:
parent
7285fcccf7
commit
c93dcdd374
16
rash.rkt
Normal file
16
rash.rkt
Normal file
|
@ -0,0 +1,16 @@
|
|||
#lang racket/base
|
||||
|
||||
(require readline/readline)
|
||||
(require racket/string)
|
||||
|
||||
(define (do command . args)
|
||||
(let ([cmd (find-executable-path command)])
|
||||
(if cmd
|
||||
(let-values ([(subproc in out err)
|
||||
(subprocess (current-output-port)
|
||||
(current-input-port)
|
||||
(current-error-port)
|
||||
cmd
|
||||
(string-join args " "))])
|
||||
(subprocess-wait subproc))
|
||||
(raise (exn:fail:filesystem command)))))
|
Loading…
Reference in New Issue
Block a user